Package com.databricks.jdbc.api.impl
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 ofSessionInfo.Use the builder to create immutable instances:
ImmutableSessionInfo.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableSessionInfo.BuilderBuilds instances of typeImmutableSessionInfo.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableSessionInfo.Builderbuilder()Creates a builder forImmutableSessionInfo.IDatabricksComputeResourcecomputeResource()static ImmutableSessionInfocopyOf(SessionInfo instance)Creates an immutable copy of aSessionInfovalue.booleanequals(Object another)This instance is equal to all instances ofImmutableSessionInfothat have equal attribute values.inthashCode()Computes a hash code from attributes:sessionId,computeResource,sessionHandle.TSessionHandlesessionHandle()StringsessionId()StringtoString()Prints the immutable valueSessionInfowith attribute values.ImmutableSessionInfowithComputeResource(IDatabricksComputeResource value)Copy the current immutable object by setting a value for thecomputeResourceattribute.ImmutableSessionInfowithSessionHandle(TSessionHandle value)Copy the current immutable object by setting a value for thesessionHandleattribute.ImmutableSessionInfowithSessionId(String value)Copy the current immutable object by setting a value for thesessionIdattribute.
-
-
-
Method Detail
-
sessionId
public String sessionId()
- Specified by:
sessionIdin interfaceSessionInfo- Returns:
- The value of the
sessionIdattribute
-
computeResource
public IDatabricksComputeResource computeResource()
- Specified by:
computeResourcein interfaceSessionInfo- Returns:
- The value of the
computeResourceattribute
-
sessionHandle
@Nullable public TSessionHandle sessionHandle()
- Specified by:
sessionHandlein interfaceSessionInfo- Returns:
- The value of the
sessionHandleattribute
-
withSessionId
public final ImmutableSessionInfo withSessionId(String value)
Copy the current immutable object by setting a value for thesessionIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sessionId- Returns:
- A modified copy of the
thisobject
-
withComputeResource
public final ImmutableSessionInfo withComputeResource(IDatabricksComputeResource value)
Copy the current immutable object by setting a value for thecomputeResourceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for computeResource- Returns:
- A modified copy of the
thisobject
-
withSessionHandle
public final ImmutableSessionInfo withSessionHandle(@Nullable TSessionHandle value)
Copy the current immutable object by setting a value for thesessionHandleattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sessionHandle (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableSessionInfothat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:sessionId,computeResource,sessionHandle.
-
toString
public String toString()
Prints the immutable valueSessionInfowith attribute values.
-
copyOf
public static ImmutableSessionInfo copyOf(SessionInfo instance)
Creates an immutable copy of aSessionInfovalue. 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 forImmutableSessionInfo.ImmutableSessionInfo.builder() .sessionId(String) // requiredsessionId.computeResource(com.databricks.jdbc.common.IDatabricksComputeResource) // requiredcomputeResource.sessionHandle(com.databricks.jdbc.model.client.thrift.generated.TSessionHandle | null) // nullablesessionHandle.build();- Returns:
- A new ImmutableSessionInfo builder
-
-