Class Session.Builder (6.74.1)

public static final class Session.Builder extends GeneratedMessageV3.Builder<Session.Builder> implements SessionOrBuilder

A session in the Cloud Spanner API.

Protobuf type google.spanner.v1.Session

Implements

SessionOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Session.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Session.Builder
Overrides

build()

public Session build()
Returns
Type Description
Session

buildPartial()

public Session buildPartial()
Returns
Type Description
Session

clear()

public Session.Builder clear()
Returns
Type Description
Session.Builder
Overrides

clearApproximateLastUseTime()

public Session.Builder clearApproximateLastUseTime()

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Session.Builder

clearCreateTime()

public Session.Builder clearCreateTime()

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Session.Builder

clearCreatorRole()

public Session.Builder clearCreatorRole()

The database role which created this session.

string creator_role = 5;

Returns
Type Description
Session.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Session.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Session.Builder
Overrides

clearLabels()

public Session.Builder clearLabels()
Returns
Type Description
Session.Builder

clearMultiplexed()

public Session.Builder clearMultiplexed()

Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.

bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Session.Builder

This builder for chaining.

clearName()

public Session.Builder clearName()

Output only. The name of the session. This is always system-assigned.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Session.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Session.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Session.Builder
Overrides

clone()

public Session.Builder clone()
Returns
Type Description
Session.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameter
Name Description
key String
Returns
Type Description
boolean

getApproximateLastUseTime()

public Timestamp getApproximateLastUseTime()

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The approximateLastUseTime.

getApproximateLastUseTimeBuilder()

public Timestamp.Builder getApproximateLastUseTimeBuilder()

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getApproximateLastUseTimeOrBuilder()

public TimestampOrBuilder getApproximateLastUseTimeOrBuilder()

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getCreateTime()

public Timestamp getCreateTime()

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getCreatorRole()

public String getCreatorRole()

The database role which created this session.

string creator_role = 5;

Returns
Type Description
String

The creatorRole.

getCreatorRoleBytes()

public ByteString getCreatorRoleBytes()

The database role which created this session.

string creator_role = 5;

Returns
Type Description
ByteString

The bytes for creatorRole.

getDefaultInstanceForType()

public Session getDefaultInstanceForType()
Returns
Type Description
Session

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameter
Name Description
key String
Returns
Type Description
String

getMultiplexed()

public boolean getMultiplexed()

Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.

bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The multiplexed.

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getName()

public String getName()

Output only. The name of the session. This is always system-assigned.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The name of the session. This is always system-assigned.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

hasApproximateLastUseTime()

public boolean hasApproximateLastUseTime()

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the approximateLastUseTime field is set.

hasCreateTime()

public boolean hasCreateTime()

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeApproximateLastUseTime(Timestamp value)

public Session.Builder mergeApproximateLastUseTime(Timestamp value)

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Session.Builder

mergeCreateTime(Timestamp value)

public Session.Builder mergeCreateTime(Timestamp value)

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Session.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Session.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Session.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Session.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Session.Builder
Overrides

mergeFrom(Session other)

public Session.Builder mergeFrom(Session other)
Parameter
Name Description
other Session
Returns
Type Description
Session.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Session.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Session.Builder
Overrides

putAllLabels(Map<String,String> values)

public Session.Builder putAllLabels(Map<String,String> values)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameter
Name Description
values Map<String,String>
Returns
Type Description
Session.Builder

putLabels(String key, String value)

public Session.Builder putLabels(String key, String value)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameters
Name Description
key String
value String
Returns
Type Description
Session.Builder

removeLabels(String key)

public Session.Builder removeLabels(String key)

The labels for the session.

  • Label keys must be between 1 and 63 characters long and must conform to the following regular expression: a-z?.
  • Label values must be between 0 and 63 characters long and must conform to the regular expression (a-z?)?.
  • No more than 64 labels can be associated with a given session.

    See https://goo.gl/xmQnxf for more information on and examples of labels.

map<string, string> labels = 2;

Parameter
Name Description
key String
Returns
Type Description
Session.Builder

setApproximateLastUseTime(Timestamp value)

public Session.Builder setApproximateLastUseTime(Timestamp value)

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Session.Builder

setApproximateLastUseTime(Timestamp.Builder builderForValue)

public Session.Builder setApproximateLastUseTime(Timestamp.Builder builderForValue)

Output only. The approximate timestamp when the session is last used. It is typically earlier than the actual last use time.

.google.protobuf.Timestamp approximate_last_use_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Session.Builder

setCreateTime(Timestamp value)

public Session.Builder setCreateTime(Timestamp value)

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value Timestamp
Returns
Type Description
Session.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Session.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. The timestamp when the session is created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
builderForValue Builder
Returns
Type Description
Session.Builder

setCreatorRole(String value)

public Session.Builder setCreatorRole(String value)

The database role which created this session.

string creator_role = 5;

Parameter
Name Description
value String

The creatorRole to set.

Returns
Type Description
Session.Builder

This builder for chaining.

setCreatorRoleBytes(ByteString value)

public Session.Builder setCreatorRoleBytes(ByteString value)

The database role which created this session.

string creator_role = 5;

Parameter
Name Description
value ByteString

The bytes for creatorRole to set.

Returns
Type Description
Session.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Session.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Session.Builder
Overrides

setMultiplexed(boolean value)

public Session.Builder setMultiplexed(boolean value)

Optional. If true, specifies a multiplexed session. A multiplexed session may be used for multiple, concurrent read-only operations but can not be used for read-write transactions, partitioned reads, or partitioned queries. Multiplexed sessions can be created via CreateSession but not via BatchCreateSessions. Multiplexed sessions may not be deleted nor listed.

bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value boolean

The multiplexed to set.

Returns
Type Description
Session.Builder

This builder for chaining.

setName(String value)

public Session.Builder setName(String value)

Output only. The name of the session. This is always system-assigned.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
Session.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Session.Builder setNameBytes(ByteString value)

Output only. The name of the session. This is always system-assigned.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
Session.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Session.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Session.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Session.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Session.Builder
Overrides