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 position
  `startOffset` - The start offset
  `endPosition` - The end position
  `endOffset` - 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

  Constructors
  Constructor
  Description
  `Hit(int startPosition, int startOffset, int endPosition, int endOffset)`
  Creates an instance of a `Hit` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compareTo(HighlightsMatch.Hit other)`
  `int`
  `endOffset()`
  Returns the value of the `endOffset` record component.
  `int`
  `endPosition()`
  Returns the value of the `endPosition` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `int`
  `startOffset()`
  Returns the value of the `startOffset` record component.
  `int`
  `startPosition()`
  Returns the value of the `startPosition` record component.
  `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

  - ### Hit

    public Hit(int startPosition, int startOffset, int endPosition, int endOffset)
    Creates an instance of a `Hit` record class.
    Parameters:
      `startPosition` - the value for the `startPosition` record component
      `startOffset` - the value for the `startOffset` record component
      `endPosition` - the value for the `endPosition` record component
      `endOffset` - the value for the `endOffset` record component

- ## Method Details

  - ### toString

    public 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

  - ### compareTo

    public int compareTo(HighlightsMatch.Hit other)
    Specified by:
      `compareTo` in interface `Comparable<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.
    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. All components in this record class 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.

  - ### startPosition

    public int startPosition()
    Returns the value of the `startPosition` record component.
    Returns:
      the value of the `startPosition` record component

  - ### startOffset

    public int startOffset()
    Returns the value of the `startOffset` record component.
    Returns:
      the value of the `startOffset` record component

  - ### endPosition

    public int endPosition()
    Returns the value of the `endPosition` record component.
    Returns:
      the value of the `endPosition` record component

  - ### endOffset

    public int endOffset()
    Returns the value of the `endOffset` record component.
    Returns:
      the value of the `endOffset` record component