# 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 Summary

  Constructors
  Constructor
  Description
  `Builder(SessionKey sessionKey)`
  Creates a new `Session.Builder` with the given session key.
  `Builder(String id)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Session.Builder`
  `appName(String appName)`
  `Session`
  `build()`
  `Session.Builder`
  `events(List<Event> events)`
  `Session.Builder`
  `id(String id)`
  `Session.Builder`
  `lastUpdateTime(Instant lastUpdateTime)`
  `Session.Builder`
  `lastUpdateTimeSeconds(double seconds)`
  `Session.Builder`
  `sessionKey(SessionKey sessionKey)`
  Sets the session key.
  `Session.Builder`
  `state(State state)`
  `Session.Builder`
  `state(Map<String,Object> state)`
  `Session.Builder`
  `userId(String userId)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder(String id)

  - ### Builder

    public Builder(SessionKey sessionKey)
    Creates a new `Session.Builder` with the given session key.

- ## 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)

  - ### lastUpdateTime

    @CanIgnoreReturnValue public Session.Builder lastUpdateTime(Instant lastUpdateTime)

  - ### lastUpdateTimeSeconds

    @CanIgnoreReturnValue public Session.Builder lastUpdateTimeSeconds(double seconds)

  - ### build

    public Session build()