Class ImmutableSessionInfo

  • All Implemented Interfaces:
    SessionInfo

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableSessionInfo
    extends Object
    implements SessionInfo
    Immutable implementation of SessionInfo.

    Use the builder to create immutable instances: ImmutableSessionInfo.builder().

    • Method Detail

      • sessionId

        public String sessionId()
        Specified by:
        sessionId in interface SessionInfo
        Returns:
        The value of the sessionId attribute
      • withSessionId

        public final ImmutableSessionInfo withSessionId​(String value)
        Copy the current immutable object by setting a value for the sessionId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for sessionId
        Returns:
        A modified copy of the this object
      • withComputeResource

        public final ImmutableSessionInfo withComputeResource​(IDatabricksComputeResource value)
        Copy the current immutable object by setting a value for the computeResource attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for computeResource
        Returns:
        A modified copy of the this object
      • withSessionHandle

        public final ImmutableSessionInfo withSessionHandle​(@Nullable
                                                            TSessionHandle value)
        Copy the current immutable object by setting a value for the sessionHandle attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for sessionHandle (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableSessionInfo that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: sessionId, computeResource, sessionHandle.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value SessionInfo with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableSessionInfo copyOf​(SessionInfo instance)
        Creates an immutable copy of a SessionInfo value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable SessionInfo instance
      • builder

        public static ImmutableSessionInfo.Builder builder()
        Creates a builder for ImmutableSessionInfo.
         ImmutableSessionInfo.builder()
            .sessionId(String) // required sessionId
            .computeResource(com.databricks.jdbc.common.IDatabricksComputeResource) // required computeResource
            .sessionHandle(com.databricks.jdbc.model.client.thrift.generated.TSessionHandle | null) // nullable sessionHandle
            .build();
         
        Returns:
        A new ImmutableSessionInfo builder