Class TransactionOptions.Builder

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

public static final class TransactionOptions.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<TransactionOptions.Builder> implements TransactionOptionsOrBuilder
 Options to use for transactions.
 
Protobuf type google.spanner.v1.TransactionOptions
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TransactionOptions.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<TransactionOptions.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<TransactionOptions.Builder>
    • getDefaultInstanceForType

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

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

      public TransactionOptions buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.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<TransactionOptions.Builder>
    • setField

      public TransactionOptions.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<TransactionOptions.Builder>
    • clearField

      public TransactionOptions.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<TransactionOptions.Builder>
    • clearOneof

      public TransactionOptions.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<TransactionOptions.Builder>
    • setRepeatedField

      public TransactionOptions.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<TransactionOptions.Builder>
    • addRepeatedField

      public TransactionOptions.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<TransactionOptions.Builder>
    • mergeFrom

      public TransactionOptions.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<TransactionOptions.Builder>
    • mergeFrom

    • isInitialized

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

      public TransactionOptions.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<TransactionOptions.Builder>
      Throws:
      IOException
    • getModeCase

      public TransactionOptions.ModeCase getModeCase()
      Specified by:
      getModeCase in interface TransactionOptionsOrBuilder
    • clearMode

      public TransactionOptions.Builder clearMode()
    • hasReadWrite

      public boolean hasReadWrite()
       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
      Specified by:
      hasReadWrite in interface TransactionOptionsOrBuilder
      Returns:
      Whether the readWrite field is set.
    • getReadWrite

      public TransactionOptions.ReadWrite getReadWrite()
       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
      Specified by:
      getReadWrite in interface TransactionOptionsOrBuilder
      Returns:
      The readWrite.
    • setReadWrite

       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
    • setReadWrite

       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
    • mergeReadWrite

       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
    • clearReadWrite

      public TransactionOptions.Builder clearReadWrite()
       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
    • getReadWriteBuilder

      public TransactionOptions.ReadWrite.Builder getReadWriteBuilder()
       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
    • getReadWriteOrBuilder

      public TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder()
       Transaction may write.
      
       Authorization to begin a read-write transaction requires
       `spanner.databases.beginOrRollbackReadWriteTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadWrite read_write = 1;
      Specified by:
      getReadWriteOrBuilder in interface TransactionOptionsOrBuilder
    • hasPartitionedDml

      public boolean hasPartitionedDml()
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
      Specified by:
      hasPartitionedDml in interface TransactionOptionsOrBuilder
      Returns:
      Whether the partitionedDml field is set.
    • getPartitionedDml

      public TransactionOptions.PartitionedDml getPartitionedDml()
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
      Specified by:
      getPartitionedDml in interface TransactionOptionsOrBuilder
      Returns:
      The partitionedDml.
    • setPartitionedDml

       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
    • setPartitionedDml

      public TransactionOptions.Builder setPartitionedDml(TransactionOptions.PartitionedDml.Builder builderForValue)
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
    • mergePartitionedDml

       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
    • clearPartitionedDml

      public TransactionOptions.Builder clearPartitionedDml()
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
    • getPartitionedDmlBuilder

      public TransactionOptions.PartitionedDml.Builder getPartitionedDmlBuilder()
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
    • getPartitionedDmlOrBuilder

      public TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder()
       Partitioned DML transaction.
      
       Authorization to begin a Partitioned DML transaction requires
       `spanner.databases.beginPartitionedDmlTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
      Specified by:
      getPartitionedDmlOrBuilder in interface TransactionOptionsOrBuilder
    • hasReadOnly

      public boolean hasReadOnly()
       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
      Specified by:
      hasReadOnly in interface TransactionOptionsOrBuilder
      Returns:
      Whether the readOnly field is set.
    • getReadOnly

      public TransactionOptions.ReadOnly getReadOnly()
       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
      Specified by:
      getReadOnly in interface TransactionOptionsOrBuilder
      Returns:
      The readOnly.
    • setReadOnly

       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
    • setReadOnly

       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
    • mergeReadOnly

       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
    • clearReadOnly

      public TransactionOptions.Builder clearReadOnly()
       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
    • getReadOnlyBuilder

      public TransactionOptions.ReadOnly.Builder getReadOnlyBuilder()
       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
    • getReadOnlyOrBuilder

      public TransactionOptions.ReadOnlyOrBuilder getReadOnlyOrBuilder()
       Transaction does not write.
      
       Authorization to begin a read-only transaction requires
       `spanner.databases.beginReadOnlyTransaction` permission
       on the `session` resource.
       
      .google.spanner.v1.TransactionOptions.ReadOnly read_only = 2;
      Specified by:
      getReadOnlyOrBuilder in interface TransactionOptionsOrBuilder
    • getExcludeTxnFromChangeStreams

      public boolean getExcludeTxnFromChangeStreams()
       When `exclude_txn_from_change_streams` is set to `true`, it prevents read
       or write transactions from being tracked in change streams.
      
       * If the DDL option `allow_txn_exclusion` is set to `true`, then the
       updates
        made within this transaction aren't recorded in the change stream.
      
       * If you don't set the DDL option `allow_txn_exclusion` or if it's
        set to `false`, then the updates made within this transaction are
        recorded in the change stream.
      
       When `exclude_txn_from_change_streams` is set to `false` or not set,
       modifications from this transaction are recorded in all change streams
       that are tracking columns modified by these transactions.
      
       The `exclude_txn_from_change_streams` option can only be specified
       for read-write or partitioned DML transactions, otherwise the API returns
       an `INVALID_ARGUMENT` error.
       
      bool exclude_txn_from_change_streams = 5;
      Specified by:
      getExcludeTxnFromChangeStreams in interface TransactionOptionsOrBuilder
      Returns:
      The excludeTxnFromChangeStreams.
    • setExcludeTxnFromChangeStreams

      public TransactionOptions.Builder setExcludeTxnFromChangeStreams(boolean value)
       When `exclude_txn_from_change_streams` is set to `true`, it prevents read
       or write transactions from being tracked in change streams.
      
       * If the DDL option `allow_txn_exclusion` is set to `true`, then the
       updates
        made within this transaction aren't recorded in the change stream.
      
       * If you don't set the DDL option `allow_txn_exclusion` or if it's
        set to `false`, then the updates made within this transaction are
        recorded in the change stream.
      
       When `exclude_txn_from_change_streams` is set to `false` or not set,
       modifications from this transaction are recorded in all change streams
       that are tracking columns modified by these transactions.
      
       The `exclude_txn_from_change_streams` option can only be specified
       for read-write or partitioned DML transactions, otherwise the API returns
       an `INVALID_ARGUMENT` error.
       
      bool exclude_txn_from_change_streams = 5;
      Parameters:
      value - The excludeTxnFromChangeStreams to set.
      Returns:
      This builder for chaining.
    • clearExcludeTxnFromChangeStreams

      public TransactionOptions.Builder clearExcludeTxnFromChangeStreams()
       When `exclude_txn_from_change_streams` is set to `true`, it prevents read
       or write transactions from being tracked in change streams.
      
       * If the DDL option `allow_txn_exclusion` is set to `true`, then the
       updates
        made within this transaction aren't recorded in the change stream.
      
       * If you don't set the DDL option `allow_txn_exclusion` or if it's
        set to `false`, then the updates made within this transaction are
        recorded in the change stream.
      
       When `exclude_txn_from_change_streams` is set to `false` or not set,
       modifications from this transaction are recorded in all change streams
       that are tracking columns modified by these transactions.
      
       The `exclude_txn_from_change_streams` option can only be specified
       for read-write or partitioned DML transactions, otherwise the API returns
       an `INVALID_ARGUMENT` error.
       
      bool exclude_txn_from_change_streams = 5;
      Returns:
      This builder for chaining.
    • getIsolationLevelValue

      public int getIsolationLevelValue()
       Isolation level for the transaction.
       
      .google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;
      Specified by:
      getIsolationLevelValue in interface TransactionOptionsOrBuilder
      Returns:
      The enum numeric value on the wire for isolationLevel.
    • setIsolationLevelValue

      public TransactionOptions.Builder setIsolationLevelValue(int value)
       Isolation level for the transaction.
       
      .google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;
      Parameters:
      value - The enum numeric value on the wire for isolationLevel to set.
      Returns:
      This builder for chaining.
    • getIsolationLevel

      public TransactionOptions.IsolationLevel getIsolationLevel()
       Isolation level for the transaction.
       
      .google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;
      Specified by:
      getIsolationLevel in interface TransactionOptionsOrBuilder
      Returns:
      The isolationLevel.
    • setIsolationLevel

       Isolation level for the transaction.
       
      .google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;
      Parameters:
      value - The isolationLevel to set.
      Returns:
      This builder for chaining.
    • clearIsolationLevel

      public TransactionOptions.Builder clearIsolationLevel()
       Isolation level for the transaction.
       
      .google.spanner.v1.TransactionOptions.IsolationLevel isolation_level = 6;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final TransactionOptions.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<TransactionOptions.Builder>
    • mergeUnknownFields

      public final TransactionOptions.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<TransactionOptions.Builder>