Package akka.javasdk.agent
Record Class SessionMemoryEntity.State
- Enclosing class:
SessionMemoryEntity
public static record SessionMemoryEntity.State(String sessionId, long maxSizeInBytes, long currentSizeInBytes, List<SessionMessage> messages)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionState(String sessionId, long maxSizeInBytes, long currentSizeInBytes, List<SessionMessage> messages) Creates an instance of aStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddMessage(SessionMessage message) clear()longReturns the value of thecurrentSizeInBytesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()longReturns the value of themaxSizeInBytesrecord component.messages()Returns the value of themessagesrecord component.Returns the value of thesessionIdrecord component.final StringtoString()Returns a string representation of this record class.withMaxSize(int newMaxSize)
-
Constructor Details
-
State
public State(String sessionId, long maxSizeInBytes, long currentSizeInBytes, List<SessionMessage> messages) Creates an instance of aStaterecord class.- Parameters:
sessionId- the value for thesessionIdrecord componentmaxSizeInBytes- the value for themaxSizeInBytesrecord componentcurrentSizeInBytes- the value for thecurrentSizeInBytesrecord componentmessages- the value for themessagesrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
withMaxSize
-
addMessage
-
clear
-
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 '=='. -
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
maxSizeInBytes
public long maxSizeInBytes()Returns the value of themaxSizeInBytesrecord component.- Returns:
- the value of the
maxSizeInBytesrecord component
-
currentSizeInBytes
public long currentSizeInBytes()Returns the value of thecurrentSizeInBytesrecord component.- Returns:
- the value of the
currentSizeInBytesrecord component
-
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-