Package org.springframework.ai.session
Class SessionEvent.Builder
java.lang.Object
org.springframework.ai.session.SessionEvent.Builder
- Enclosing class:
- SessionEvent
Builds a
SessionEvent. The id is a random UUID, the timestamp
Instant.now(), the payload and the metadata empty, unless set; the session
id is required. The type is EventType.MESSAGE when a message is set, which
that type requires and no other type allows.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the event, checking that the type and the message agree.The event id; a random UUID by default.The message aEventType.MESSAGEevent wraps; required for that type, not allowed for any other.Adds one metadata entry.Replaces the metadata.Adds one payload entry.Replaces the payload of an event that is not a message.The session the event belongs to; required.When the event was recorded;Instant.now()by default.What the event records;EventType.MESSAGEby default when a message is set.
-
Method Details
-
id
The event id; a random UUID by default. -
sessionId
The session the event belongs to; required. -
timestamp
When the event was recorded;Instant.now()by default. -
type
What the event records;EventType.MESSAGEby default when a message is set. -
message
The message aEventType.MESSAGEevent wraps; required for that type, not allowed for any other. -
payload
Replaces the payload of an event that is not a message. -
payload
Adds one payload entry. -
metadata
Replaces the metadata. -
metadata
Adds one metadata entry. -
build
Builds the event, checking that the type and the message agree.
-