Class Write (3.22.0)

public final class Write extends GeneratedMessageV3 implements WriteOrBuilder

A write on a document.

Protobuf type google.firestore.v1.Write

Implements

WriteOrBuilder

Static Fields

CURRENT_DOCUMENT_FIELD_NUMBER

public static final int CURRENT_DOCUMENT_FIELD_NUMBER
Field Value
Type Description
int

DELETE_FIELD_NUMBER

public static final int DELETE_FIELD_NUMBER
Field Value
Type Description
int

TRANSFORM_FIELD_NUMBER

public static final int TRANSFORM_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_FIELD_NUMBER

public static final int UPDATE_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_MASK_FIELD_NUMBER

public static final int UPDATE_MASK_FIELD_NUMBER
Field Value
Type Description
int

UPDATE_TRANSFORMS_FIELD_NUMBER

public static final int UPDATE_TRANSFORMS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Write getDefaultInstance()
Returns
Type Description
Write

getDescriptor()

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

newBuilder()

public static Write.Builder newBuilder()
Returns
Type Description
Write.Builder

newBuilder(Write prototype)

public static Write.Builder newBuilder(Write prototype)
Parameter
Name Description
prototype Write
Returns
Type Description
Write.Builder

parseDelimitedFrom(InputStream input)

public static Write parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Write parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Write parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Write parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Write parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Write parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Write parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Write parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Write parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Write parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Write parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Write parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Write
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Write> parser()
Returns
Type Description
Parser<Write>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCurrentDocument()

public Precondition getCurrentDocument()

An optional precondition on the document.

The write will fail if this is set and not met by the target document.

.google.firestore.v1.Precondition current_document = 4;

Returns
Type Description
Precondition

The currentDocument.

getCurrentDocumentOrBuilder()

public PreconditionOrBuilder getCurrentDocumentOrBuilder()

An optional precondition on the document.

The write will fail if this is set and not met by the target document.

.google.firestore.v1.Precondition current_document = 4;

Returns
Type Description
PreconditionOrBuilder

getDefaultInstanceForType()

public Write getDefaultInstanceForType()
Returns
Type Description
Write

getDelete()

public String getDelete()

A document name to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

string delete = 2;

Returns
Type Description
String

The delete.

getDeleteBytes()

public ByteString getDeleteBytes()

A document name to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

string delete = 2;

Returns
Type Description
ByteString

The bytes for delete.

getOperationCase()

public Write.OperationCase getOperationCase()
Returns
Type Description
Write.OperationCase

getParserForType()

public Parser<Write> getParserForType()
Returns
Type Description
Parser<Write>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getTransform()

public DocumentTransform getTransform()

Applies a transformation to a document.

.google.firestore.v1.DocumentTransform transform = 6;

Returns
Type Description
DocumentTransform

The transform.

getTransformOrBuilder()

public DocumentTransformOrBuilder getTransformOrBuilder()

Applies a transformation to a document.

.google.firestore.v1.DocumentTransform transform = 6;

Returns
Type Description
DocumentTransformOrBuilder

getUpdate()

public Document getUpdate()

A document to write.

.google.firestore.v1.Document update = 1;

Returns
Type Description
Document

The update.

getUpdateMask()

public DocumentMask getUpdateMask()

The fields to update in this write.

This field can be set only when the operation is update. If the mask is not set for an update and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.

.google.firestore.v1.DocumentMask update_mask = 3;

Returns
Type Description
DocumentMask

The updateMask.

getUpdateMaskOrBuilder()

public DocumentMaskOrBuilder getUpdateMaskOrBuilder()

The fields to update in this write.

This field can be set only when the operation is update. If the mask is not set for an update and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.

.google.firestore.v1.DocumentMask update_mask = 3;

Returns
Type Description
DocumentMaskOrBuilder

getUpdateOrBuilder()

public DocumentOrBuilder getUpdateOrBuilder()

A document to write.

.google.firestore.v1.Document update = 1;

Returns
Type Description
DocumentOrBuilder

getUpdateTransforms(int index)

public DocumentTransform.FieldTransform getUpdateTransforms(int index)

The transforms to perform after update.

This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order.

repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7;

Parameter
Name Description
index int
Returns
Type Description
DocumentTransform.FieldTransform

getUpdateTransformsCount()

public int getUpdateTransformsCount()

The transforms to perform after update.

This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order.

repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7;

Returns
Type Description
int

getUpdateTransformsList()

public List<DocumentTransform.FieldTransform> getUpdateTransformsList()

The transforms to perform after update.

This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order.

repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7;

Returns
Type Description
List<FieldTransform>

getUpdateTransformsOrBuilder(int index)

public DocumentTransform.FieldTransformOrBuilder getUpdateTransformsOrBuilder(int index)

The transforms to perform after update.

This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order.

repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7;

Parameter
Name Description
index int
Returns
Type Description
DocumentTransform.FieldTransformOrBuilder

getUpdateTransformsOrBuilderList()

public List<? extends DocumentTransform.FieldTransformOrBuilder> getUpdateTransformsOrBuilderList()

The transforms to perform after update.

This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order.

repeated .google.firestore.v1.DocumentTransform.FieldTransform update_transforms = 7;

Returns
Type Description
List<? extends com.google.firestore.v1.DocumentTransform.FieldTransformOrBuilder>

hasCurrentDocument()

public boolean hasCurrentDocument()

An optional precondition on the document.

The write will fail if this is set and not met by the target document.

.google.firestore.v1.Precondition current_document = 4;

Returns
Type Description
boolean

Whether the currentDocument field is set.

hasDelete()

public boolean hasDelete()

A document name to delete. In the format: projects/{project_id}/databases/{database_id}/documents/{document_path}.

string delete = 2;

Returns
Type Description
boolean

Whether the delete field is set.

hasTransform()

public boolean hasTransform()

Applies a transformation to a document.

.google.firestore.v1.DocumentTransform transform = 6;

Returns
Type Description
boolean

Whether the transform field is set.

hasUpdate()

public boolean hasUpdate()

A document to write.

.google.firestore.v1.Document update = 1;

Returns
Type Description
boolean

Whether the update field is set.

hasUpdateMask()

public boolean hasUpdateMask()

The fields to update in this write.

This field can be set only when the operation is update. If the mask is not set for an update and the document exists, any existing data will be overwritten. If the mask is set and the document on the server has fields not covered by the mask, they are left unchanged. Fields referenced in the mask, but not present in the input document, are deleted from the document on the server. The field paths in this mask must not contain a reserved field name.

.google.firestore.v1.DocumentMask update_mask = 3;

Returns
Type Description
boolean

Whether the updateMask field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Write.Builder newBuilderForType()
Returns
Type Description
Write.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Write.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Write.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Write.Builder toBuilder()
Returns
Type Description
Write.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException