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 aState
record class. -
Method Summary
Modifier and TypeMethodDescriptionaddMessage
(SessionMessage message) clear()
long
Returns the value of thecurrentSizeInBytes
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
isEmpty()
long
Returns the value of themaxSizeInBytes
record component.messages()
Returns the value of themessages
record component.Returns the value of thesessionId
record component.final String
toString()
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 aState
record class.- Parameters:
sessionId
- the value for thesessionId
record componentmaxSizeInBytes
- the value for themaxSizeInBytes
record componentcurrentSizeInBytes
- the value for thecurrentSizeInBytes
record componentmessages
- the value for themessages
record 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 thesessionId
record component.- Returns:
- the value of the
sessionId
record component
-
maxSizeInBytes
public long maxSizeInBytes()Returns the value of themaxSizeInBytes
record component.- Returns:
- the value of the
maxSizeInBytes
record component
-
currentSizeInBytes
public long currentSizeInBytes()Returns the value of thecurrentSizeInBytes
record component.- Returns:
- the value of the
currentSizeInBytes
record component
-
messages
Returns the value of themessages
record component.- Returns:
- the value of the
messages
record component
-