Package com.tnsai.session
Record Class SessionSearchResult.MatchedTurn
java.lang.Object
java.lang.Record
com.tnsai.session.SessionSearchResult.MatchedTurn
- Enclosing class:
SessionSearchResult
public static record SessionSearchResult.MatchedTurn(int turnIndex, ConversationTurn turn, String highlight, List<SessionSearchResult.MatchPosition> positions)
extends Record
A matched turn within a session.
-
Constructor Summary
ConstructorsConstructorDescriptionMatchedTurn(int turnIndex, ConversationTurn turn, String highlight, List<SessionSearchResult.MatchPosition> positions) Creates an instance of aMatchedTurnrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehighlightrecord component.of(int index, ConversationTurn turn, String highlight) Creates a matched turn.Returns the value of thepositionsrecord component.final StringtoString()Returns a string representation of this record class.turn()Returns the value of theturnrecord component.intReturns the value of theturnIndexrecord component.
-
Constructor Details
-
MatchedTurn
public MatchedTurn(int turnIndex, ConversationTurn turn, String highlight, List<SessionSearchResult.MatchPosition> positions) Creates an instance of aMatchedTurnrecord class.- Parameters:
turnIndex- the value for theturnIndexrecord componentturn- the value for theturnrecord componenthighlight- the value for thehighlightrecord componentpositions- the value for thepositionsrecord component
-
-
Method Details
-
of
public static SessionSearchResult.MatchedTurn of(int index, ConversationTurn turn, String highlight) Creates a matched turn. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
turnIndex
public int turnIndex()Returns the value of theturnIndexrecord component.- Returns:
- the value of the
turnIndexrecord component
-
turn
Returns the value of theturnrecord component.- Returns:
- the value of the
turnrecord component
-
highlight
Returns the value of thehighlightrecord component.- Returns:
- the value of the
highlightrecord component
-
positions
Returns the value of thepositionsrecord component.- Returns:
- the value of the
positionsrecord component
-