Class Session.Builder

java.lang.Object
com.google.adk.sessions.Session.Builder
Enclosing class:
Session

public static final class Session.Builder extends Object
Builder for Session.
  • Constructor Details

  • Method Details

    • id

      @CanIgnoreReturnValue public Session.Builder id(String id)
    • sessionKey

      @CanIgnoreReturnValue public Session.Builder sessionKey(SessionKey sessionKey)
      Sets the session key.
    • state

      @CanIgnoreReturnValue public Session.Builder state(State state)
    • state

      @CanIgnoreReturnValue public Session.Builder state(Map<String,Object> state)
    • appName

      @CanIgnoreReturnValue public Session.Builder appName(String appName)
    • userId

      @CanIgnoreReturnValue public Session.Builder userId(String userId)
    • events

      @CanIgnoreReturnValue public Session.Builder events(List<Event> events)
    • eventsView

      @Deprecated @CanIgnoreReturnValue public Session.Builder eventsView(List<Event> events)
      Deprecated.
      Not a real deprecation - a warn-off for application code from a seam meant for ADK's own framework and interop adapters; use events(List) instead.
      Backs Session.events() with the given list directly, without copying, so the session reflects a caller-owned live or converting view whose events grow as the owner appends. The caller keeps ownership and the list's own semantics - thread-safety, and a read-only view throwing on add - so ordinary code should use events(List), which defensively copies.
    • lastUpdateTime

      @CanIgnoreReturnValue public Session.Builder lastUpdateTime(Instant lastUpdateTime)
    • lastUpdateTimeSeconds

      @CanIgnoreReturnValue public Session.Builder lastUpdateTimeSeconds(double seconds)
    • build

      public Session build()