Class WriteRequest.Builder

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

public static final class WriteRequest.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<WriteRequest.Builder> implements WriteRequestOrBuilder
 The request for [Firestore.Write][google.firestore.v1.Firestore.Write].

 The first request creates a stream, or resumes an existing one from a token.

 When creating a new stream, the server replies with a response containing
 only an ID and a token, to use in the next request.

 When resuming a stream, the server first streams any responses later than the
 given token, then a response containing only an up-to-date token, to use in
 the next request.
 
Protobuf type google.firestore.v1.WriteRequest
  • 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<WriteRequest.Builder>
    • internalGetMutableMapFieldReflection

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

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

      public WriteRequest.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<WriteRequest.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<WriteRequest.Builder>
    • getDefaultInstanceForType

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

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

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

      public WriteRequest.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<WriteRequest.Builder>
    • setField

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

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

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

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

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

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

      public WriteRequest.Builder mergeFrom(WriteRequest other)
    • isInitialized

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

      public WriteRequest.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<WriteRequest.Builder>
      Throws:
      IOException
    • getDatabase

      public String getDatabase()
       Required. The database name. In the format:
       `projects/{project_id}/databases/{database_id}`.
       This is only required in the first message.
       
      string database = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDatabase in interface WriteRequestOrBuilder
      Returns:
      The database.
    • getDatabaseBytes

      public com.google.protobuf.ByteString getDatabaseBytes()
       Required. The database name. In the format:
       `projects/{project_id}/databases/{database_id}`.
       This is only required in the first message.
       
      string database = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDatabaseBytes in interface WriteRequestOrBuilder
      Returns:
      The bytes for database.
    • setDatabase

      public WriteRequest.Builder setDatabase(String value)
       Required. The database name. In the format:
       `projects/{project_id}/databases/{database_id}`.
       This is only required in the first message.
       
      string database = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The database to set.
      Returns:
      This builder for chaining.
    • clearDatabase

      public WriteRequest.Builder clearDatabase()
       Required. The database name. In the format:
       `projects/{project_id}/databases/{database_id}`.
       This is only required in the first message.
       
      string database = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setDatabaseBytes

      public WriteRequest.Builder setDatabaseBytes(com.google.protobuf.ByteString value)
       Required. The database name. In the format:
       `projects/{project_id}/databases/{database_id}`.
       This is only required in the first message.
       
      string database = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for database to set.
      Returns:
      This builder for chaining.
    • getStreamId

      public String getStreamId()
       The ID of the write stream to resume.
       This may only be set in the first message. When left empty, a new write
       stream will be created.
       
      string stream_id = 2;
      Specified by:
      getStreamId in interface WriteRequestOrBuilder
      Returns:
      The streamId.
    • getStreamIdBytes

      public com.google.protobuf.ByteString getStreamIdBytes()
       The ID of the write stream to resume.
       This may only be set in the first message. When left empty, a new write
       stream will be created.
       
      string stream_id = 2;
      Specified by:
      getStreamIdBytes in interface WriteRequestOrBuilder
      Returns:
      The bytes for streamId.
    • setStreamId

      public WriteRequest.Builder setStreamId(String value)
       The ID of the write stream to resume.
       This may only be set in the first message. When left empty, a new write
       stream will be created.
       
      string stream_id = 2;
      Parameters:
      value - The streamId to set.
      Returns:
      This builder for chaining.
    • clearStreamId

      public WriteRequest.Builder clearStreamId()
       The ID of the write stream to resume.
       This may only be set in the first message. When left empty, a new write
       stream will be created.
       
      string stream_id = 2;
      Returns:
      This builder for chaining.
    • setStreamIdBytes

      public WriteRequest.Builder setStreamIdBytes(com.google.protobuf.ByteString value)
       The ID of the write stream to resume.
       This may only be set in the first message. When left empty, a new write
       stream will be created.
       
      string stream_id = 2;
      Parameters:
      value - The bytes for streamId to set.
      Returns:
      This builder for chaining.
    • getWritesList

      public List<Write> getWritesList()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
      Specified by:
      getWritesList in interface WriteRequestOrBuilder
    • getWritesCount

      public int getWritesCount()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
      Specified by:
      getWritesCount in interface WriteRequestOrBuilder
    • getWrites

      public Write getWrites(int index)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
      Specified by:
      getWrites in interface WriteRequestOrBuilder
    • setWrites

      public WriteRequest.Builder setWrites(int index, Write value)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • setWrites

      public WriteRequest.Builder setWrites(int index, Write.Builder builderForValue)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addWrites

      public WriteRequest.Builder addWrites(Write value)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addWrites

      public WriteRequest.Builder addWrites(int index, Write value)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addWrites

      public WriteRequest.Builder addWrites(Write.Builder builderForValue)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addWrites

      public WriteRequest.Builder addWrites(int index, Write.Builder builderForValue)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addAllWrites

      public WriteRequest.Builder addAllWrites(Iterable<? extends Write> values)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • clearWrites

      public WriteRequest.Builder clearWrites()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • removeWrites

      public WriteRequest.Builder removeWrites(int index)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • getWritesBuilder

      public Write.Builder getWritesBuilder(int index)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • getWritesOrBuilder

      public WriteOrBuilder getWritesOrBuilder(int index)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
      Specified by:
      getWritesOrBuilder in interface WriteRequestOrBuilder
    • getWritesOrBuilderList

      public List<? extends WriteOrBuilder> getWritesOrBuilderList()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
      Specified by:
      getWritesOrBuilderList in interface WriteRequestOrBuilder
    • addWritesBuilder

      public Write.Builder addWritesBuilder()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • addWritesBuilder

      public Write.Builder addWritesBuilder(int index)
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • getWritesBuilderList

      public List<Write.Builder> getWritesBuilderList()
       The writes to apply.
      
       Always executed atomically and in order.
       This must be empty on the first request.
       This may be empty on the last request.
       This must not be empty on all other requests.
       
      repeated .google.firestore.v1.Write writes = 3;
    • getStreamToken

      public com.google.protobuf.ByteString getStreamToken()
       A stream token that was previously sent by the server.
      
       The client should set this field to the token from the most recent
       [WriteResponse][google.firestore.v1.WriteResponse] it has received. This
       acknowledges that the client has received responses up to this token. After
       sending this token, earlier tokens may not be used anymore.
      
       The server may close the stream if there are too many unacknowledged
       responses.
      
       Leave this field unset when creating a new stream. To resume a stream at
       a specific point, set this field and the `stream_id` field.
      
       Leave this field unset when creating a new stream.
       
      bytes stream_token = 4;
      Specified by:
      getStreamToken in interface WriteRequestOrBuilder
      Returns:
      The streamToken.
    • setStreamToken

      public WriteRequest.Builder setStreamToken(com.google.protobuf.ByteString value)
       A stream token that was previously sent by the server.
      
       The client should set this field to the token from the most recent
       [WriteResponse][google.firestore.v1.WriteResponse] it has received. This
       acknowledges that the client has received responses up to this token. After
       sending this token, earlier tokens may not be used anymore.
      
       The server may close the stream if there are too many unacknowledged
       responses.
      
       Leave this field unset when creating a new stream. To resume a stream at
       a specific point, set this field and the `stream_id` field.
      
       Leave this field unset when creating a new stream.
       
      bytes stream_token = 4;
      Parameters:
      value - The streamToken to set.
      Returns:
      This builder for chaining.
    • clearStreamToken

      public WriteRequest.Builder clearStreamToken()
       A stream token that was previously sent by the server.
      
       The client should set this field to the token from the most recent
       [WriteResponse][google.firestore.v1.WriteResponse] it has received. This
       acknowledges that the client has received responses up to this token. After
       sending this token, earlier tokens may not be used anymore.
      
       The server may close the stream if there are too many unacknowledged
       responses.
      
       Leave this field unset when creating a new stream. To resume a stream at
       a specific point, set this field and the `stream_id` field.
      
       Leave this field unset when creating a new stream.
       
      bytes stream_token = 4;
      Returns:
      This builder for chaining.
    • getLabelsCount

      public int getLabelsCount()
      Description copied from interface: WriteRequestOrBuilder
       Labels associated with this write request.
       
      map<string, string> labels = 5;
      Specified by:
      getLabelsCount in interface WriteRequestOrBuilder
    • containsLabels

      public boolean containsLabels(String key)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
      Specified by:
      containsLabels in interface WriteRequestOrBuilder
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels in interface WriteRequestOrBuilder
    • getLabelsMap

      public Map<String,String> getLabelsMap()
       Labels associated with this write request.
       
      map<string, string> labels = 5;
      Specified by:
      getLabelsMap in interface WriteRequestOrBuilder
    • getLabelsOrDefault

      public String getLabelsOrDefault(String key, String defaultValue)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
      Specified by:
      getLabelsOrDefault in interface WriteRequestOrBuilder
    • getLabelsOrThrow

      public String getLabelsOrThrow(String key)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
      Specified by:
      getLabelsOrThrow in interface WriteRequestOrBuilder
    • clearLabels

      public WriteRequest.Builder clearLabels()
    • removeLabels

      public WriteRequest.Builder removeLabels(String key)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
    • getMutableLabels

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

      public WriteRequest.Builder putLabels(String key, String value)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
    • putAllLabels

      public WriteRequest.Builder putAllLabels(Map<String,String> values)
       Labels associated with this write request.
       
      map<string, string> labels = 5;
    • setUnknownFields

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

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