Package org.apache.lucene.monitor
Record Class HighlightsMatch.Hit
java.lang.Object
java.lang.Record
org.apache.lucene.monitor.HighlightsMatch.Hit
- Record Components:
startPosition
- The start positionstartOffset
- The start offsetendPosition
- The end positionendOffset
- The end offset
- All Implemented Interfaces:
Comparable<HighlightsMatch.Hit>
- Enclosing class:
HighlightsMatch
public static record HighlightsMatch.Hit(int startPosition, int startOffset, int endPosition, int endOffset)
extends Record
implements Comparable<HighlightsMatch.Hit>
Represents an individual hit
-
Constructor Summary
ConstructorsConstructorDescriptionHit
(int startPosition, int startOffset, int endPosition, int endOffset) Creates an instance of aHit
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(HighlightsMatch.Hit other) int
Returns the value of theendOffset
record component.int
Returns the value of theendPosition
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thestartOffset
record component.int
Returns the value of thestartPosition
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
Hit
public Hit(int startPosition, int startOffset, int endPosition, int endOffset) Creates an instance of aHit
record class.- Parameters:
startPosition
- the value for thestartPosition
record componentstartOffset
- the value for thestartOffset
record componentendPosition
- the value for theendPosition
record componentendOffset
- the value for theendOffset
record component
-
-
Method Details
-
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. -
compareTo
- Specified by:
compareTo
in interfaceComparable<HighlightsMatch.Hit>
-
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. -
equals
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. All components in this record class are compared with '=='. -
startPosition
public int startPosition()Returns the value of thestartPosition
record component.- Returns:
- the value of the
startPosition
record component
-
startOffset
public int startOffset()Returns the value of thestartOffset
record component.- Returns:
- the value of the
startOffset
record component
-
endPosition
public int endPosition()Returns the value of theendPosition
record component.- Returns:
- the value of the
endPosition
record component
-
endOffset
public int endOffset()Returns the value of theendOffset
record component.- Returns:
- the value of the
endOffset
record component
-