Record Class CompactionRequest
java.lang.Object
java.lang.Record
org.springframework.ai.session.compaction.CompactionRequest
- Record Components:
session- the sessionevents- its active view, oldest firstcurrentTurnCount- the turns in the view: its non-synthetic user messages
public record CompactionRequest(Session session, List<SessionEvent> events, int currentTurnCount)
extends Record
What a
CompactionTrigger and a CompactionStrategy decide on.- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Constructor Summary
ConstructorsConstructorDescriptionCompactionRequest(Session session, List<SessionEvent> events, int currentTurnCount) Creates an instance of aCompactionRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecurrentTurnCountrecord component.final booleanIndicates whether some other object is "equal to" this one.events()Returns the value of theeventsrecord component.final inthashCode()Returns a hash code value for this object.static CompactionRequestof(Session session, List<SessionEvent> events) A request for the session and its view, counting the turns.session()Returns the value of thesessionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompactionRequest
Creates an instance of aCompactionRequestrecord class.- Parameters:
session- the value for thesessionrecord componentevents- the value for theeventsrecord componentcurrentTurnCount- the value for thecurrentTurnCountrecord component
-
-
Method Details
-
of
A request for the session and its view, counting the turns. -
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 '=='. -
session
Returns the value of thesessionrecord component.- Returns:
- the value of the
sessionrecord component
-
events
Returns the value of theeventsrecord component.- Returns:
- the value of the
eventsrecord component
-
currentTurnCount
public int currentTurnCount()Returns the value of thecurrentTurnCountrecord component.- Returns:
- the value of the
currentTurnCountrecord component
-