Send feedback
  
   
 
  
    
      Class TransactionOptions.Builder (3.33.2) 
  
  
  
   
  
    
  
  
    
    
    
    
    
  Version latestkeyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   final   class  TransactionOptions . Builder   extends   GeneratedMessageV3 . Builder<TransactionOptions . Builder >  implements   TransactionOptionsOrBuilder  
   Options for creating a new transaction.
 Protobuf type google.firestore.v1.TransactionOptions
    Inherited Members 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder() 
    
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int) 
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int) 
    
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString) 
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int) 
    
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int) 
    
    
    
    
      com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder) 
    
    
    
    
    
    
    
    
    
    
    
    
   
  Static Methods
   
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
  
  Methods
   
  addRepeatedField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   TransactionOptions . Builder   addRepeatedField ( Descriptors . FieldDescriptor   field ,   Object   value )  
  
  
  Overrides 
  
  build() 
  
    
public   TransactionOptions   build ()  
  
  buildPartial() 
  
    
public   TransactionOptions   buildPartial ()  
  
  clear() 
  
    
public   TransactionOptions . Builder   clear ()  
  
  Overrides 
  
  clearField(Descriptors.FieldDescriptor field) 
  
    
public   TransactionOptions . Builder   clearField ( Descriptors . FieldDescriptor   field )  
  
  
  Overrides 
  
  clearMode() 
  
    
public   TransactionOptions . Builder   clearMode ()  
  
  clearOneof(Descriptors.OneofDescriptor oneof) 
  
    
public   TransactionOptions . Builder   clearOneof ( Descriptors . OneofDescriptor   oneof )  
  
  
  Overrides 
  
  clearReadOnly() 
  
    
public   TransactionOptions . Builder   clearReadOnly ()  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
clearReadWrite() 
  
    
public   TransactionOptions . Builder   clearReadWrite ()  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
clone() 
  
    
public   TransactionOptions . Builder   clone ()  
  
  Overrides 
  
  getDefaultInstanceForType() 
  
    
public   TransactionOptions   getDefaultInstanceForType ()  
  
  getDescriptorForType() 
  
    
public   Descriptors . Descriptor   getDescriptorForType ()  
  
  Overrides 
  
  getModeCase() 
  
    
public   TransactionOptions . ModeCase   getModeCase ()  
  
  getReadOnly() 
  
    
public   TransactionOptions . ReadOnly   getReadOnly ()  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
getReadOnlyBuilder() 
  
    
public   TransactionOptions . ReadOnly . Builder   getReadOnlyBuilder ()  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
getReadOnlyOrBuilder() 
  
    
public   TransactionOptions . ReadOnlyOrBuilder   getReadOnlyOrBuilder ()  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
getReadWrite() 
  
    
public   TransactionOptions . ReadWrite   getReadWrite ()  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
getReadWriteBuilder() 
  
    
public   TransactionOptions . ReadWrite . Builder   getReadWriteBuilder ()  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
getReadWriteOrBuilder() 
  
    
public   TransactionOptions . ReadWriteOrBuilder   getReadWriteOrBuilder ()  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
hasReadOnly() 
  
    
public   boolean   hasReadOnly ()  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the readOnly field is set.
 
     
  
  hasReadWrite() 
  
    
public   boolean   hasReadWrite ()  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
    
      
        Returns  
      
        Type Description  
      
        boolean Whether the readWrite field is set.
 
     
  
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
  
  Overrides 
  
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
  
  Overrides 
  
  mergeFrom(TransactionOptions other) 
  
    
public   TransactionOptions . Builder   mergeFrom ( TransactionOptions   other )  
  
  
  
    
public   TransactionOptions . Builder   mergeFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  
  
  Overrides 
  
  
  mergeFrom(Message other) 
  
    
public   TransactionOptions . Builder   mergeFrom ( Message   other )  
  
    
      
        Parameter  
      
        Name Description  
      
        otherMessage  
     
  
  
  Overrides 
  
  mergeReadOnly(TransactionOptions.ReadOnly value) 
  
    
public   TransactionOptions . Builder   mergeReadOnly ( TransactionOptions . ReadOnly   value )  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
mergeReadWrite(TransactionOptions.ReadWrite value) 
  
    
public   TransactionOptions . Builder   mergeReadWrite ( TransactionOptions . ReadWrite   value )  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
mergeUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   TransactionOptions . Builder   mergeUnknownFields ( UnknownFieldSet   unknownFields )  
  
  
  Overrides 
  
  setField(Descriptors.FieldDescriptor field, Object value) 
  
    
public   TransactionOptions . Builder   setField ( Descriptors . FieldDescriptor   field ,   Object   value )  
  
  
  Overrides 
  
  setReadOnly(TransactionOptions.ReadOnly value) 
  
    
public   TransactionOptions . Builder   setReadOnly ( TransactionOptions . ReadOnly   value )  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
setReadOnly(TransactionOptions.ReadOnly.Builder builderForValue) 
  
    
public   TransactionOptions . Builder   setReadOnly ( TransactionOptions . ReadOnly . Builder   builderForValue )  
   The transaction can only be used for read operations.
 .google.firestore.v1.TransactionOptions.ReadOnly read_only = 2;
setReadWrite(TransactionOptions.ReadWrite value) 
  
    
public   TransactionOptions . Builder   setReadWrite ( TransactionOptions . ReadWrite   value )  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
setReadWrite(TransactionOptions.ReadWrite.Builder builderForValue) 
  
    
public   TransactionOptions . Builder   setReadWrite ( TransactionOptions . ReadWrite . Builder   builderForValue )  
   The transaction can be used for both read and write operations.
 .google.firestore.v1.TransactionOptions.ReadWrite read_write = 3;
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value) 
  
    
public   TransactionOptions . Builder   setRepeatedField ( Descriptors . FieldDescriptor   field ,   int   index ,   Object   value )  
  
  
  Overrides 
  
  setUnknownFields(UnknownFieldSet unknownFields) 
  
    
public   final   TransactionOptions . Builder   setUnknownFields ( UnknownFieldSet   unknownFields )  
  
  
  Overrides 
  
 
     
    
  
  
  
     
  
    
    
      
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-11 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]