Class CommitRequest.Builder (2.17.6)

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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.datastore.v1.Mutation>
Returns
TypeDescription
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
NameDescription
valueMutation
Returns
TypeDescription
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
NameDescription
builderForValueMutation.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueMutation
Returns
TypeDescription
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
NameDescription
indexint
builderForValueMutation.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Mutation.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
CommitRequest.Builder
Overrides

build()

public CommitRequest build()
Returns
TypeDescription
CommitRequest

buildPartial()

public CommitRequest buildPartial()
Returns
TypeDescription
CommitRequest

clear()

public CommitRequest.Builder clear()
Returns
TypeDescription
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
TypeDescription
CommitRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CommitRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
CommitRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public CommitRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
CommitRequest.Builder

This builder for chaining.

clearTransactionSelector()

public CommitRequest.Builder clearTransactionSelector()
Returns
TypeDescription
CommitRequest.Builder

clone()

public CommitRequest.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for databaseId.

getDefaultInstanceForType()

public CommitRequest getDefaultInstanceForType()
Returns
TypeDescription
CommitRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMode()

public CommitRequest.Mode getMode()

The type of commit to perform. Defaults to TRANSACTIONAL.

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

Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The transaction.

getTransactionSelectorCase()

public CommitRequest.TransactionSelectorCase getTransactionSelectorCase()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the transaction field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CommitRequest other)

public CommitRequest.Builder mergeFrom(CommitRequest other)
Parameter
NameDescription
otherCommitRequest
Returns
TypeDescription
CommitRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CommitRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CommitRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CommitRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueTransactionOptions
Returns
TypeDescription
CommitRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
valueString

The databaseId to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for databaseId to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CommitRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueCommitRequest.Mode

The mode to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
indexint
valueMutation
Returns
TypeDescription
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
NameDescription
indexint
builderForValueMutation.Builder
Returns
TypeDescription
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
NameDescription
valueString

The projectId to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for projectId to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueTransactionOptions
Returns
TypeDescription
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
NameDescription
builderForValueTransactionOptions.Builder
Returns
TypeDescription
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
NameDescription
valueByteString

The transaction to set.

Returns
TypeDescription
CommitRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CommitRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CommitRequest.Builder
Overrides