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 aHitrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(HighlightsMatch.Hit other) intReturns the value of theendOffsetrecord component.intReturns the value of theendPositionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thestartOffsetrecord component.intReturns the value of thestartPositionrecord 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 aHitrecord class.- Parameters:
startPosition- the value for thestartPositionrecord componentstartOffset- the value for thestartOffsetrecord componentendPosition- the value for theendPositionrecord componentendOffset- the value for theendOffsetrecord 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:
compareToin 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 thestartPositionrecord component.- Returns:
- the value of the
startPositionrecord component
-
startOffset
public int startOffset()Returns the value of thestartOffsetrecord component.- Returns:
- the value of the
startOffsetrecord component
-
endPosition
public int endPosition()Returns the value of theendPositionrecord component.- Returns:
- the value of the
endPositionrecord component
-
endOffset
public int endOffset()Returns the value of theendOffsetrecord component.- Returns:
- the value of the
endOffsetrecord component
-