Package org.apache.lucene.search.uhighlight

# Record Class UHComponents

java.lang.Object
java.lang.Record
org.apache.lucene.search.uhighlight.UHComponents

Record Components:
  `terms` - Query: all terms we extracted (some may be position sensitive)
  `phraseHelper` - Query: position-sensitive information
  `automata` - Query: wildcards (i.e. multi-term query), not position sensitive
  `hasUnrecognizedQueryPart` - Query: if part of the query (other than the extracted terms / automata) is a leaf we don't know

public record UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags) extends Record
A parameter object to hold the components a `FieldOffsetStrategy` needs.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

## Constructor Summary

Constructors
Constructor
Description
`UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags)`
Creates an instance of a `UHComponents` record class.

## Method Summary

Modifier and Type
Method
Description
`LabelledCharArrayMatcher[]`
`automata()`
Returns the value of the `automata` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`String`
`field()`
Returns the value of the `field` record component.
`Predicate<String>`
`fieldMatcher()`
Returns the value of the `fieldMatcher` record component.
`final int`
`hashCode()`
Returns a hash code value for this object.
`boolean`
`hasUnrecognizedQueryPart()`
Returns the value of the `hasUnrecognizedQueryPart` record component.
`Set<UnifiedHighlighter.HighlightFlag>`
`highlightFlags()`
Returns the value of the `highlightFlags` record component.
`PhraseHelper`
`phraseHelper()`
Returns the value of the `phraseHelper` record component.
`Query`
`query()`
Returns the value of the `query` record component.
`BytesRef[]`
`terms()`
Returns the value of the `terms` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### UHComponents

public UHComponents(String field, Predicate<String> fieldMatcher, Query query, BytesRef[] terms, PhraseHelper phraseHelper, LabelledCharArrayMatcher[] automata, boolean hasUnrecognizedQueryPart, Set<UnifiedHighlighter.HighlightFlag> highlightFlags)
Creates an instance of a `UHComponents` record class.

Parameters:
  `field` - the value for the `field` record component
  `fieldMatcher` - the value for the `fieldMatcher` record component
  `query` - the value for the `query` record component
  `terms` - the value for the `terms` record component
  `phraseHelper` - the value for the `phraseHelper` record component
  `automata` - the value for the `automata` record component
  `hasUnrecognizedQueryPart` - the value for the `hasUnrecognizedQueryPart` record component
  `highlightFlags` - the value for the `highlightFlags` record component

## Method Details

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### field

public String field()
Returns the value of the `field` record component.

Returns:
  the value of the `field` record component

### fieldMatcher

public Predicate<String> fieldMatcher()
Returns the value of the `fieldMatcher` record component.

Returns:
  the value of the `fieldMatcher` record component

### query

public Query query()
Returns the value of the `query` record component.

Returns:
  the value of the `query` record component

### terms

public BytesRef[] terms()
Returns the value of the `terms` record component.

Returns:
  the value of the `terms` record component

### phraseHelper

public PhraseHelper phraseHelper()
Returns the value of the `phraseHelper` record component.

Returns:
  the value of the `phraseHelper` record component

### automata

public LabelledCharArrayMatcher[] automata()
Returns the value of the `automata` record component.

Returns:
  the value of the `automata` record component

### hasUnrecognizedQueryPart

public boolean hasUnrecognizedQueryPart()
Returns the value of the `hasUnrecognizedQueryPart` record component.

Returns:
  the value of the `hasUnrecognizedQueryPart` record component

### highlightFlags

public Set<UnifiedHighlighter.HighlightFlag> highlightFlags()
Returns the value of the `highlightFlags` record component.

Returns:
  the value of the `highlightFlags` record component