Record Class McpStoredSession

java.lang.Object
java.lang.Record
com.soklet.McpStoredSession

@Immutable public record McpStoredSession(@NonNull String sessionId, @NonNull Class<? extends McpEndpoint> endpointClass, @NonNull Instant createdAt, @NonNull Instant lastActivityAt, @NonNull Boolean initialized, @NonNull Boolean initializedNotificationReceived, @Nullable String protocolVersion, @Nullable McpClientCapabilities clientCapabilities, @Nullable McpNegotiatedCapabilities negotiatedCapabilities, @NonNull McpSessionContext sessionContext, @Nullable Instant terminatedAt, @NonNull Long version) extends Record
Immutable stored representation of an MCP session.
Author:
Mark Allen
  • Constructor Details

    • McpStoredSession

      public McpStoredSession(@NonNull String sessionId, @NonNull Class<? extends McpEndpoint> endpointClass, @NonNull Instant createdAt, @NonNull Instant lastActivityAt, @NonNull Boolean initialized, @NonNull Boolean initializedNotificationReceived, @Nullable String protocolVersion, @Nullable McpClientCapabilities clientCapabilities, @Nullable McpNegotiatedCapabilities negotiatedCapabilities, @NonNull McpSessionContext sessionContext, @Nullable Instant terminatedAt, @NonNull Long version)
      Creates an instance of a McpStoredSession record class.
      Parameters:
      sessionId - the value for the sessionId record component
      endpointClass - the value for the endpointClass record component
      createdAt - the value for the createdAt record component
      lastActivityAt - the value for the lastActivityAt record component
      initialized - the value for the initialized record component
      initializedNotificationReceived - the value for the initializedNotificationReceived record component
      protocolVersion - the value for the protocolVersion record component
      clientCapabilities - the value for the clientCapabilities record component
      negotiatedCapabilities - the value for the negotiatedCapabilities record component
      sessionContext - the value for the sessionContext record component
      terminatedAt - the value for the terminatedAt record component
      version - the value for the version record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sessionId

      Returns the value of the sessionId record component.
      Returns:
      the value of the sessionId record component
    • endpointClass

      public @NonNull Class<? extends McpEndpoint> endpointClass()
      Returns the value of the endpointClass record component.
      Returns:
      the value of the endpointClass record component
    • createdAt

      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • lastActivityAt

      Returns the value of the lastActivityAt record component.
      Returns:
      the value of the lastActivityAt record component
    • initialized

      Returns the value of the initialized record component.
      Returns:
      the value of the initialized record component
    • initializedNotificationReceived

      Returns the value of the initializedNotificationReceived record component.
      Returns:
      the value of the initializedNotificationReceived record component
    • protocolVersion

      Returns the value of the protocolVersion record component.
      Returns:
      the value of the protocolVersion record component
    • clientCapabilities

      Returns the value of the clientCapabilities record component.
      Returns:
      the value of the clientCapabilities record component
    • negotiatedCapabilities

      Returns the value of the negotiatedCapabilities record component.
      Returns:
      the value of the negotiatedCapabilities record component
    • sessionContext

      Returns the value of the sessionContext record component.
      Returns:
      the value of the sessionContext record component
    • terminatedAt

      Returns the value of the terminatedAt record component.
      Returns:
      the value of the terminatedAt record component
    • version

      public @NonNull Long version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component