Package com.google.adk.sessions
Class Session
java.lang.Object
com.google.adk.JsonBaseModel
com.google.adk.sessions.Session
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddEvents(Collection<Event> events) appName()static Session.Builderbuilder(SessionKey sessionKey) Creates a newSession.Builderwith the given session key.static Session.Builderevents()Deprecated.static Sessiondoubleid()com.google.common.collect.ImmutableList<Event>Returns a thread-safe, immutable snapshot of the session's events, synchronizing on the backingevents()list.voidlastUpdateTime(Instant lastUpdateTime) Returns the session key.state()toString()userId()Methods inherited from class com.google.adk.JsonBaseModel
fromJsonNode, fromJsonString, getMapper, toJson, toJsonNode, toJsonString
-
Method Details
-
builder
-
builder
Creates a newSession.Builderwith the given session key. -
sessionKey
Returns the session key. -
id
-
state
-
events
Deprecated.PreferimmutableEvents()when reading or iterating over events (to avoidConcurrentModificationException), andaddEvent(Event)oraddEvents(Collection)when appending events.Returns the mutable list of events backing this session, which also serves as the monitor for all event-helper synchronization. -
immutableEvents
Returns a thread-safe, immutable snapshot of the session's events, synchronizing on the backingevents()list. Use this method whenever reading, iterating, streaming, filtering, or slicing (List.subList(int, int)) session events to avoidConcurrentModificationExceptionunder concurrent modifications. -
addEvent
-
addEvents
-
appName
-
userId
-
lastUpdateTime
-
lastUpdateTime
-
getLastUpdateTimeAsDouble
public double getLastUpdateTimeAsDouble() -
toString
-
fromJson
-
immutableEvents()when reading or iterating over events (to avoidConcurrentModificationException), andaddEvent(Event)oraddEvents(Collection)when appending events.