Class Session.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
com.google.spanner.v1.Session.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, SessionOrBuilder, Cloneable
Enclosing class:
Session

public static final class Session.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder> implements SessionOrBuilder
 A session in the Cloud Spanner API.
 
Protobuf type google.spanner.v1.Session
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • clear

      public Session.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • getDefaultInstanceForType

      public Session getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Session build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Session buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public Session.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • setField

      public Session.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • clearField

      public Session.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • clearOneof

      public Session.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • setRepeatedField

      public Session.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • addRepeatedField

      public Session.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • mergeFrom

      public Session.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Session.Builder>
    • mergeFrom

      public Session.Builder mergeFrom(Session other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • mergeFrom

      public Session.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Session.Builder>
      Throws:
      IOException
    • 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];
      Specified by:
      getName in interface SessionOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Output only. The name of the session. This is always system-assigned.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getNameBytes in interface SessionOrBuilder
      Returns:
      The bytes for name.
    • setName

      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];
      Parameters:
      value - The name to set.
      Returns:
      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:
      This builder for chaining.
    • setNameBytes

      public Session.Builder setNameBytes(com.google.protobuf.ByteString value)
       Output only. The name of the session. This is always system-assigned.
       
      string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: SessionOrBuilder
       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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
      Specified by:
      getLabelsCount in interface SessionOrBuilder
    • containsLabels

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
      Specified by:
      containsLabels in interface SessionOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface SessionOrBuilder
    • 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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
      Specified by:
      getLabelsMap in interface SessionOrBuilder
    • getLabelsOrDefault

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
      Specified by:
      getLabelsOrDefault in interface SessionOrBuilder
    • getLabelsOrThrow

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
      Specified by:
      getLabelsOrThrow in interface SessionOrBuilder
    • clearLabels

      public Session.Builder clearLabels()
    • removeLabels

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
    • getMutableLabels

      @Deprecated public Map<String,String> getMutableLabels()
      Deprecated.
      Use alternate mutation accessors instead.
    • putLabels

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
    • putAllLabels

      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]([-a-z0-9]*[a-z0-9])?`.
        * Label values must be between 0 and 63 characters long and must conform
          to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
        * 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;
    • 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];
      Specified by:
      hasCreateTime in interface SessionOrBuilder
      Returns:
      Whether the createTime field is set.
    • getCreateTime

      public com.google.protobuf.Timestamp getCreateTime()
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTime in interface SessionOrBuilder
      Returns:
      The createTime.
    • setCreateTime

      public Session.Builder setCreateTime(com.google.protobuf.Timestamp value)
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • setCreateTime

      public Session.Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • mergeCreateTime

      public Session.Builder mergeCreateTime(com.google.protobuf.Timestamp value)
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • 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];
    • getCreateTimeBuilder

      public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder()
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
    • getCreateTimeOrBuilder

      public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
       Output only. The timestamp when the session is created.
       
      .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCreateTimeOrBuilder in interface SessionOrBuilder
    • 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];
      Specified by:
      hasApproximateLastUseTime in interface SessionOrBuilder
      Returns:
      Whether the approximateLastUseTime field is set.
    • getApproximateLastUseTime

      public com.google.protobuf.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];
      Specified by:
      getApproximateLastUseTime in interface SessionOrBuilder
      Returns:
      The approximateLastUseTime.
    • setApproximateLastUseTime

      public Session.Builder setApproximateLastUseTime(com.google.protobuf.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];
    • setApproximateLastUseTime

      public Session.Builder setApproximateLastUseTime(com.google.protobuf.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];
    • mergeApproximateLastUseTime

      public Session.Builder mergeApproximateLastUseTime(com.google.protobuf.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];
    • 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];
    • getApproximateLastUseTimeBuilder

      public com.google.protobuf.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];
    • getApproximateLastUseTimeOrBuilder

      public com.google.protobuf.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];
      Specified by:
      getApproximateLastUseTimeOrBuilder in interface SessionOrBuilder
    • getCreatorRole

      public String getCreatorRole()
       The database role which created this session.
       
      string creator_role = 5;
      Specified by:
      getCreatorRole in interface SessionOrBuilder
      Returns:
      The creatorRole.
    • getCreatorRoleBytes

      public com.google.protobuf.ByteString getCreatorRoleBytes()
       The database role which created this session.
       
      string creator_role = 5;
      Specified by:
      getCreatorRoleBytes in interface SessionOrBuilder
      Returns:
      The bytes for creatorRole.
    • setCreatorRole

      public Session.Builder setCreatorRole(String value)
       The database role which created this session.
       
      string creator_role = 5;
      Parameters:
      value - The creatorRole to set.
      Returns:
      This builder for chaining.
    • clearCreatorRole

      public Session.Builder clearCreatorRole()
       The database role which created this session.
       
      string creator_role = 5;
      Returns:
      This builder for chaining.
    • setCreatorRoleBytes

      public Session.Builder setCreatorRoleBytes(com.google.protobuf.ByteString value)
       The database role which created this session.
       
      string creator_role = 5;
      Parameters:
      value - The bytes for creatorRole to set.
      Returns:
      This builder for chaining.
    • 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][google.spanner.v1.Spanner.CreateSession] but not via
       [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
       Multiplexed sessions may not be deleted nor listed.
       
      bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getMultiplexed in interface SessionOrBuilder
      Returns:
      The multiplexed.
    • setMultiplexed

      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][google.spanner.v1.Spanner.CreateSession] but not via
       [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
       Multiplexed sessions may not be deleted nor listed.
       
      bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The multiplexed to set.
      Returns:
      This builder for chaining.
    • 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][google.spanner.v1.Spanner.CreateSession] but not via
       [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
       Multiplexed sessions may not be deleted nor listed.
       
      bool multiplexed = 6 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final Session.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>
    • mergeUnknownFields

      public final Session.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Session.Builder>