Class CommitRequest.Builder (2.20.2)

public static final class CommitRequest.Builder extends GeneratedMessageV3.Builder<CommitRequest.Builder> implements CommitRequestOrBuilder

The request for Datastore.Commit.

Protobuf type google.datastore.v1.CommitRequest

Static Methods

getDescriptor()

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

Methods

addAllMutations(Iterable<? extends Mutation> values)

public CommitRequest.Builder addAllMutations(Iterable<? extends Mutation> values)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
values Iterable<? extends com.google.datastore.v1.Mutation>
Returns
Type Description
CommitRequest.Builder

addMutations(Mutation value)

public CommitRequest.Builder addMutations(Mutation value)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
value Mutation
Returns
Type Description
CommitRequest.Builder

addMutations(Mutation.Builder builderForValue)

public CommitRequest.Builder addMutations(Mutation.Builder builderForValue)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
builderForValue Mutation.Builder
Returns
Type Description
CommitRequest.Builder

addMutations(int index, Mutation value)

public CommitRequest.Builder addMutations(int index, Mutation value)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameters
Name Description
index int
value Mutation
Returns
Type Description
CommitRequest.Builder

addMutations(int index, Mutation.Builder builderForValue)

public CommitRequest.Builder addMutations(int index, Mutation.Builder builderForValue)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameters
Name Description
index int
builderForValue Mutation.Builder
Returns
Type Description
CommitRequest.Builder

addMutationsBuilder()

public Mutation.Builder addMutationsBuilder()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
Mutation.Builder

addMutationsBuilder(int index)

public Mutation.Builder addMutationsBuilder(int index)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
Mutation.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CommitRequest.Builder
Overrides

build()

public CommitRequest build()
Returns
Type Description
CommitRequest

buildPartial()

public CommitRequest buildPartial()
Returns
Type Description
CommitRequest

clear()

public CommitRequest.Builder clear()
Returns
Type Description
CommitRequest.Builder
Overrides

clearDatabaseId()

public CommitRequest.Builder clearDatabaseId()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CommitRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
CommitRequest.Builder
Overrides

clearMode()

public CommitRequest.Builder clearMode()

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

clearMutations()

public CommitRequest.Builder clearMutations()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
CommitRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public CommitRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CommitRequest.Builder
Overrides

clearProjectId()

public CommitRequest.Builder clearProjectId()

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

clearSingleUseTransaction()

public CommitRequest.Builder clearSingleUseTransaction()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
CommitRequest.Builder

clearTransaction()

public CommitRequest.Builder clearTransaction()

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

clearTransactionSelector()

public CommitRequest.Builder clearTransactionSelector()
Returns
Type Description
CommitRequest.Builder

clone()

public CommitRequest.Builder clone()
Returns
Type Description
CommitRequest.Builder
Overrides

getDatabaseId()

public String getDatabaseId()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Returns
Type Description
String

The databaseId.

getDatabaseIdBytes()

public ByteString getDatabaseIdBytes()

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Returns
Type Description
ByteString

The bytes for databaseId.

getDefaultInstanceForType()

public CommitRequest getDefaultInstanceForType()
Returns
Type Description
CommitRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getMode()

public CommitRequest.Mode getMode()

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Returns
Type Description
CommitRequest.Mode

The mode.

getModeValue()

public int getModeValue()

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Returns
Type Description
int

The enum numeric value on the wire for mode.

getMutations(int index)

public Mutation getMutations(int index)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
Mutation

getMutationsBuilder(int index)

public Mutation.Builder getMutationsBuilder(int index)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
Mutation.Builder

getMutationsBuilderList()

public List<Mutation.Builder> getMutationsBuilderList()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
List<Builder>

getMutationsCount()

public int getMutationsCount()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
int

getMutationsList()

public List<Mutation> getMutationsList()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
List<Mutation>

getMutationsOrBuilder(int index)

public MutationOrBuilder getMutationsOrBuilder(int index)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
MutationOrBuilder

getMutationsOrBuilderList()

public List<? extends MutationOrBuilder> getMutationsOrBuilderList()

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Returns
Type Description
List<? extends com.google.datastore.v1.MutationOrBuilder>

getProjectId()

public String getProjectId()

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The projectId.

getProjectIdBytes()

public ByteString getProjectIdBytes()

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for projectId.

getSingleUseTransaction()

public TransactionOptions getSingleUseTransaction()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
TransactionOptions

The singleUseTransaction.

getSingleUseTransactionBuilder()

public TransactionOptions.Builder getSingleUseTransactionBuilder()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
TransactionOptions.Builder

getSingleUseTransactionOrBuilder()

public TransactionOptionsOrBuilder getSingleUseTransactionOrBuilder()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
TransactionOptionsOrBuilder

getTransaction()

public ByteString getTransaction()

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Returns
Type Description
ByteString

The transaction.

getTransactionSelectorCase()

public CommitRequest.TransactionSelectorCase getTransactionSelectorCase()
Returns
Type Description
CommitRequest.TransactionSelectorCase

hasSingleUseTransaction()

public boolean hasSingleUseTransaction()

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Returns
Type Description
boolean

Whether the singleUseTransaction field is set.

hasTransaction()

public boolean hasTransaction()

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Returns
Type Description
boolean

Whether the transaction field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CommitRequest other)

public CommitRequest.Builder mergeFrom(CommitRequest other)
Parameter
Name Description
other CommitRequest
Returns
Type Description
CommitRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CommitRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CommitRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CommitRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CommitRequest.Builder
Overrides

mergeSingleUseTransaction(TransactionOptions value)

public CommitRequest.Builder mergeSingleUseTransaction(TransactionOptions value)

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Parameter
Name Description
value TransactionOptions
Returns
Type Description
CommitRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CommitRequest.Builder
Overrides

removeMutations(int index)

public CommitRequest.Builder removeMutations(int index)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameter
Name Description
index int
Returns
Type Description
CommitRequest.Builder

setDatabaseId(String value)

public CommitRequest.Builder setDatabaseId(String value)

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Parameter
Name Description
value String

The databaseId to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setDatabaseIdBytes(ByteString value)

public CommitRequest.Builder setDatabaseIdBytes(ByteString value)

The ID of the database against which to make the request.

'(default)' is not allowed; please use empty string '' to refer the default database.

string database_id = 9;

Parameter
Name Description
value ByteString

The bytes for databaseId to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CommitRequest.Builder
Overrides

setMode(CommitRequest.Mode value)

public CommitRequest.Builder setMode(CommitRequest.Mode value)

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Parameter
Name Description
value CommitRequest.Mode

The mode to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setModeValue(int value)

public CommitRequest.Builder setModeValue(int value)

The type of commit to perform. Defaults to TRANSACTIONAL.

.google.datastore.v1.CommitRequest.Mode mode = 5;

Parameter
Name Description
value int

The enum numeric value on the wire for mode to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setMutations(int index, Mutation value)

public CommitRequest.Builder setMutations(int index, Mutation value)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameters
Name Description
index int
value Mutation
Returns
Type Description
CommitRequest.Builder

setMutations(int index, Mutation.Builder builderForValue)

public CommitRequest.Builder setMutations(int index, Mutation.Builder builderForValue)

The mutations to perform.

When mode is TRANSACTIONAL, mutations affecting a single entity are applied in order. The following sequences of mutations affecting a single entity are not permitted in a single Commit request:

  • insert followed by insert
  • update followed by insert
  • upsert followed by insert
  • delete followed by update

    When mode is NON_TRANSACTIONAL, no two mutations may affect a single entity.

repeated .google.datastore.v1.Mutation mutations = 6;

Parameters
Name Description
index int
builderForValue Mutation.Builder
Returns
Type Description
CommitRequest.Builder

setProjectId(String value)

public CommitRequest.Builder setProjectId(String value)

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The projectId to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setProjectIdBytes(ByteString value)

public CommitRequest.Builder setProjectIdBytes(ByteString value)

Required. The ID of the project against which to make the request.

string project_id = 8 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for projectId to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CommitRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CommitRequest.Builder
Overrides

setSingleUseTransaction(TransactionOptions value)

public CommitRequest.Builder setSingleUseTransaction(TransactionOptions value)

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Parameter
Name Description
value TransactionOptions
Returns
Type Description
CommitRequest.Builder

setSingleUseTransaction(TransactionOptions.Builder builderForValue)

public CommitRequest.Builder setSingleUseTransaction(TransactionOptions.Builder builderForValue)

Options for beginning a new transaction for this request. The transaction is committed when the request completes. If specified, TransactionOptions.mode must be TransactionOptions.ReadWrite.

.google.datastore.v1.TransactionOptions single_use_transaction = 10;

Parameter
Name Description
builderForValue TransactionOptions.Builder
Returns
Type Description
CommitRequest.Builder

setTransaction(ByteString value)

public CommitRequest.Builder setTransaction(ByteString value)

The identifier of the transaction associated with the commit. A transaction identifier is returned by a call to Datastore.BeginTransaction.

bytes transaction = 1;

Parameter
Name Description
value ByteString

The transaction to set.

Returns
Type Description
CommitRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CommitRequest.Builder
Overrides