Package ai.mindconnect.cli
Record Class CliState
java.lang.Object
java.lang.Record
ai.mindconnect.cli.CliState
Persisted "where the user was" between CLI runs.
Written at three points: when the user enters the session menu, when a session
becomes active, and when the user returns to the agent list. Read once at startup
and used to jump straight back into the previous view.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCliState(CliState.View view, UUID lastAgentId, UUID lastSessionId) Creates an instance of aCliStaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CliStateactiveSession(UUID agentId, UUID sessionId) static CliStatestatic CliStateempty()final booleanIndicates whether some other object is "equal to" this one.static CliStatefromJson(CliState.View view, UUID lastAgentId, UUID lastSessionId) final inthashCode()Returns a hash code value for this object.Returns the value of thelastAgentIdrecord component.Returns the value of thelastSessionIdrecord component.static CliStatesessionList(UUID agentId) final StringtoString()Returns a string representation of this record class.view()Returns the value of theviewrecord component.
-
Constructor Details
-
CliState
Creates an instance of aCliStaterecord class.- Parameters:
view- the value for theviewrecord componentlastAgentId- the value for thelastAgentIdrecord componentlastSessionId- the value for thelastSessionIdrecord component
-
-
Method Details
-
fromJson
-
empty
-
agentList
-
sessionList
-
activeSession
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
view
Returns the value of theviewrecord component.- Returns:
- the value of the
viewrecord component
-
lastAgentId
Returns the value of thelastAgentIdrecord component.- Returns:
- the value of the
lastAgentIdrecord component
-
lastSessionId
Returns the value of thelastSessionIdrecord component.- Returns:
- the value of the
lastSessionIdrecord component
-