# Class ImmutableSessionInfo

java.lang.Object
com.databricks.jdbc.api.impl.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()`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`ImmutableSessionInfo.Builder`
Builds instances of type `ImmutableSessionInfo`.

## Method Summary

Modifier and Type
Method
Description
`static ImmutableSessionInfo.Builder`
`builder()`
Creates a builder for `ImmutableSessionInfo`.
`IDatabricksComputeResource`
`computeResource()`
`static ImmutableSessionInfo`
`copyOf(SessionInfo instance)`
Creates an immutable copy of a `SessionInfo` value.
`boolean`
`equals(Object another)`
This instance is equal to all instances of `ImmutableSessionInfo` that have equal attribute values.
`int`
`hashCode()`
Computes a hash code from attributes: `sessionId`, `computeResource`, `sessionHandle`.
`TSessionHandle`
`sessionHandle()`
`String`
`sessionId()`
`String`
`toString()`
Prints the immutable value `SessionInfo` with attribute values.
`final ImmutableSessionInfo`
`withComputeResource(IDatabricksComputeResource value)`
Copy the current immutable object by setting a value for the `computeResource` attribute.
`final ImmutableSessionInfo`
`withSessionHandle(TSessionHandle value)`
Copy the current immutable object by setting a value for the `sessionHandle` attribute.
`final ImmutableSessionInfo`
`withSessionId(String value)`
Copy the current immutable object by setting a value for the `sessionId` attribute.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Method Details

### sessionId

public String sessionId()

Specified by:
  `sessionId` in interface `SessionInfo`
Returns:
  The value of the `sessionId` attribute

### computeResource

public IDatabricksComputeResource computeResource()

Specified by:
  `computeResource` in interface `SessionInfo`
Returns:
  The value of the `computeResource` attribute

### sessionHandle

@Nullable public TSessionHandle sessionHandle()

Specified by:
  `sessionHandle` in interface `SessionInfo`
Returns:
  The value of the `sessionHandle` 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