com.google.datastore.v1.Mutation Maven / Gradle / Ivy
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/datastore/v1/datastore.proto
package com.google.datastore.v1;
/**
*
*
*
* A mutation to apply to an entity.
*
*
* Protobuf type {@code google.datastore.v1.Mutation}
*/
public final class Mutation extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.datastore.v1.Mutation)
MutationOrBuilder {
private static final long serialVersionUID = 0L;
// Use Mutation.newBuilder() to construct.
private Mutation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Mutation() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Mutation();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_Mutation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_Mutation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.Mutation.class, com.google.datastore.v1.Mutation.Builder.class);
}
private int operationCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object operation_;
public enum OperationCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
INSERT(4),
UPDATE(5),
UPSERT(6),
DELETE(7),
OPERATION_NOT_SET(0);
private final int value;
private OperationCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static OperationCase valueOf(int value) {
return forNumber(value);
}
public static OperationCase forNumber(int value) {
switch (value) {
case 4:
return INSERT;
case 5:
return UPDATE;
case 6:
return UPSERT;
case 7:
return DELETE;
case 0:
return OPERATION_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public OperationCase getOperationCase() {
return OperationCase.forNumber(operationCase_);
}
private int conflictDetectionStrategyCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object conflictDetectionStrategy_;
public enum ConflictDetectionStrategyCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
BASE_VERSION(8),
UPDATE_TIME(11),
CONFLICTDETECTIONSTRATEGY_NOT_SET(0);
private final int value;
private ConflictDetectionStrategyCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ConflictDetectionStrategyCase valueOf(int value) {
return forNumber(value);
}
public static ConflictDetectionStrategyCase forNumber(int value) {
switch (value) {
case 8:
return BASE_VERSION;
case 11:
return UPDATE_TIME;
case 0:
return CONFLICTDETECTIONSTRATEGY_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public ConflictDetectionStrategyCase getConflictDetectionStrategyCase() {
return ConflictDetectionStrategyCase.forNumber(conflictDetectionStrategyCase_);
}
public static final int INSERT_FIELD_NUMBER = 4;
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*
* @return Whether the insert field is set.
*/
@java.lang.Override
public boolean hasInsert() {
return operationCase_ == 4;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*
* @return The insert.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getInsert() {
if (operationCase_ == 4) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getInsertOrBuilder() {
if (operationCase_ == 4) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
public static final int UPDATE_FIELD_NUMBER = 5;
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*
* @return Whether the update field is set.
*/
@java.lang.Override
public boolean hasUpdate() {
return operationCase_ == 5;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*
* @return The update.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getUpdate() {
if (operationCase_ == 5) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getUpdateOrBuilder() {
if (operationCase_ == 5) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
public static final int UPSERT_FIELD_NUMBER = 6;
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*
* @return Whether the upsert field is set.
*/
@java.lang.Override
public boolean hasUpsert() {
return operationCase_ == 6;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*
* @return The upsert.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getUpsert() {
if (operationCase_ == 6) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getUpsertOrBuilder() {
if (operationCase_ == 6) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
public static final int DELETE_FIELD_NUMBER = 7;
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*
* @return Whether the delete field is set.
*/
@java.lang.Override
public boolean hasDelete() {
return operationCase_ == 7;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*
* @return The delete.
*/
@java.lang.Override
public com.google.datastore.v1.Key getDelete() {
if (operationCase_ == 7) {
return (com.google.datastore.v1.Key) operation_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
@java.lang.Override
public com.google.datastore.v1.KeyOrBuilder getDeleteOrBuilder() {
if (operationCase_ == 7) {
return (com.google.datastore.v1.Key) operation_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
public static final int BASE_VERSION_FIELD_NUMBER = 8;
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @return Whether the baseVersion field is set.
*/
@java.lang.Override
public boolean hasBaseVersion() {
return conflictDetectionStrategyCase_ == 8;
}
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @return The baseVersion.
*/
@java.lang.Override
public long getBaseVersion() {
if (conflictDetectionStrategyCase_ == 8) {
return (java.lang.Long) conflictDetectionStrategy_;
}
return 0L;
}
public static final int UPDATE_TIME_FIELD_NUMBER = 11;
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*
* @return Whether the updateTime field is set.
*/
@java.lang.Override
public boolean hasUpdateTime() {
return conflictDetectionStrategyCase_ == 11;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*
* @return The updateTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getUpdateTime() {
if (conflictDetectionStrategyCase_ == 11) {
return (com.google.protobuf.Timestamp) conflictDetectionStrategy_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
if (conflictDetectionStrategyCase_ == 11) {
return (com.google.protobuf.Timestamp) conflictDetectionStrategy_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (operationCase_ == 4) {
output.writeMessage(4, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 5) {
output.writeMessage(5, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 6) {
output.writeMessage(6, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 7) {
output.writeMessage(7, (com.google.datastore.v1.Key) operation_);
}
if (conflictDetectionStrategyCase_ == 8) {
output.writeInt64(8, (long) ((java.lang.Long) conflictDetectionStrategy_));
}
if (conflictDetectionStrategyCase_ == 11) {
output.writeMessage(11, (com.google.protobuf.Timestamp) conflictDetectionStrategy_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (operationCase_ == 4) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
4, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 5) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
5, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 6) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
6, (com.google.datastore.v1.Entity) operation_);
}
if (operationCase_ == 7) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
7, (com.google.datastore.v1.Key) operation_);
}
if (conflictDetectionStrategyCase_ == 8) {
size +=
com.google.protobuf.CodedOutputStream.computeInt64Size(
8, (long) ((java.lang.Long) conflictDetectionStrategy_));
}
if (conflictDetectionStrategyCase_ == 11) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
11, (com.google.protobuf.Timestamp) conflictDetectionStrategy_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1.Mutation)) {
return super.equals(obj);
}
com.google.datastore.v1.Mutation other = (com.google.datastore.v1.Mutation) obj;
if (!getOperationCase().equals(other.getOperationCase())) return false;
switch (operationCase_) {
case 4:
if (!getInsert().equals(other.getInsert())) return false;
break;
case 5:
if (!getUpdate().equals(other.getUpdate())) return false;
break;
case 6:
if (!getUpsert().equals(other.getUpsert())) return false;
break;
case 7:
if (!getDelete().equals(other.getDelete())) return false;
break;
case 0:
default:
}
if (!getConflictDetectionStrategyCase().equals(other.getConflictDetectionStrategyCase()))
return false;
switch (conflictDetectionStrategyCase_) {
case 8:
if (getBaseVersion() != other.getBaseVersion()) return false;
break;
case 11:
if (!getUpdateTime().equals(other.getUpdateTime())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (operationCase_) {
case 4:
hash = (37 * hash) + INSERT_FIELD_NUMBER;
hash = (53 * hash) + getInsert().hashCode();
break;
case 5:
hash = (37 * hash) + UPDATE_FIELD_NUMBER;
hash = (53 * hash) + getUpdate().hashCode();
break;
case 6:
hash = (37 * hash) + UPSERT_FIELD_NUMBER;
hash = (53 * hash) + getUpsert().hashCode();
break;
case 7:
hash = (37 * hash) + DELETE_FIELD_NUMBER;
hash = (53 * hash) + getDelete().hashCode();
break;
case 0:
default:
}
switch (conflictDetectionStrategyCase_) {
case 8:
hash = (37 * hash) + BASE_VERSION_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getBaseVersion());
break;
case 11:
hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER;
hash = (53 * hash) + getUpdateTime().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.datastore.v1.Mutation parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.Mutation parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.Mutation parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.Mutation parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.Mutation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.Mutation parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.Mutation parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Mutation parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.datastore.v1.Mutation parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Mutation parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.datastore.v1.Mutation parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Mutation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.datastore.v1.Mutation prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* A mutation to apply to an entity.
*
*
* Protobuf type {@code google.datastore.v1.Mutation}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.datastore.v1.Mutation)
com.google.datastore.v1.MutationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_Mutation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_Mutation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.Mutation.class,
com.google.datastore.v1.Mutation.Builder.class);
}
// Construct using com.google.datastore.v1.Mutation.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (insertBuilder_ != null) {
insertBuilder_.clear();
}
if (updateBuilder_ != null) {
updateBuilder_.clear();
}
if (upsertBuilder_ != null) {
upsertBuilder_.clear();
}
if (deleteBuilder_ != null) {
deleteBuilder_.clear();
}
if (updateTimeBuilder_ != null) {
updateTimeBuilder_.clear();
}
operationCase_ = 0;
operation_ = null;
conflictDetectionStrategyCase_ = 0;
conflictDetectionStrategy_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.datastore.v1.DatastoreProto
.internal_static_google_datastore_v1_Mutation_descriptor;
}
@java.lang.Override
public com.google.datastore.v1.Mutation getDefaultInstanceForType() {
return com.google.datastore.v1.Mutation.getDefaultInstance();
}
@java.lang.Override
public com.google.datastore.v1.Mutation build() {
com.google.datastore.v1.Mutation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.datastore.v1.Mutation buildPartial() {
com.google.datastore.v1.Mutation result = new com.google.datastore.v1.Mutation(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.google.datastore.v1.Mutation result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(com.google.datastore.v1.Mutation result) {
result.operationCase_ = operationCase_;
result.operation_ = this.operation_;
if (operationCase_ == 4 && insertBuilder_ != null) {
result.operation_ = insertBuilder_.build();
}
if (operationCase_ == 5 && updateBuilder_ != null) {
result.operation_ = updateBuilder_.build();
}
if (operationCase_ == 6 && upsertBuilder_ != null) {
result.operation_ = upsertBuilder_.build();
}
if (operationCase_ == 7 && deleteBuilder_ != null) {
result.operation_ = deleteBuilder_.build();
}
result.conflictDetectionStrategyCase_ = conflictDetectionStrategyCase_;
result.conflictDetectionStrategy_ = this.conflictDetectionStrategy_;
if (conflictDetectionStrategyCase_ == 11 && updateTimeBuilder_ != null) {
result.conflictDetectionStrategy_ = updateTimeBuilder_.build();
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.datastore.v1.Mutation) {
return mergeFrom((com.google.datastore.v1.Mutation) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.datastore.v1.Mutation other) {
if (other == com.google.datastore.v1.Mutation.getDefaultInstance()) return this;
switch (other.getOperationCase()) {
case INSERT:
{
mergeInsert(other.getInsert());
break;
}
case UPDATE:
{
mergeUpdate(other.getUpdate());
break;
}
case UPSERT:
{
mergeUpsert(other.getUpsert());
break;
}
case DELETE:
{
mergeDelete(other.getDelete());
break;
}
case OPERATION_NOT_SET:
{
break;
}
}
switch (other.getConflictDetectionStrategyCase()) {
case BASE_VERSION:
{
setBaseVersion(other.getBaseVersion());
break;
}
case UPDATE_TIME:
{
mergeUpdateTime(other.getUpdateTime());
break;
}
case CONFLICTDETECTIONSTRATEGY_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 34:
{
input.readMessage(getInsertFieldBuilder().getBuilder(), extensionRegistry);
operationCase_ = 4;
break;
} // case 34
case 42:
{
input.readMessage(getUpdateFieldBuilder().getBuilder(), extensionRegistry);
operationCase_ = 5;
break;
} // case 42
case 50:
{
input.readMessage(getUpsertFieldBuilder().getBuilder(), extensionRegistry);
operationCase_ = 6;
break;
} // case 50
case 58:
{
input.readMessage(getDeleteFieldBuilder().getBuilder(), extensionRegistry);
operationCase_ = 7;
break;
} // case 58
case 64:
{
conflictDetectionStrategy_ = input.readInt64();
conflictDetectionStrategyCase_ = 8;
break;
} // case 64
case 90:
{
input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry);
conflictDetectionStrategyCase_ = 11;
break;
} // case 90
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int operationCase_ = 0;
private java.lang.Object operation_;
public OperationCase getOperationCase() {
return OperationCase.forNumber(operationCase_);
}
public Builder clearOperation() {
operationCase_ = 0;
operation_ = null;
onChanged();
return this;
}
private int conflictDetectionStrategyCase_ = 0;
private java.lang.Object conflictDetectionStrategy_;
public ConflictDetectionStrategyCase getConflictDetectionStrategyCase() {
return ConflictDetectionStrategyCase.forNumber(conflictDetectionStrategyCase_);
}
public Builder clearConflictDetectionStrategy() {
conflictDetectionStrategyCase_ = 0;
conflictDetectionStrategy_ = null;
onChanged();
return this;
}
private int bitField0_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
insertBuilder_;
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*
* @return Whether the insert field is set.
*/
@java.lang.Override
public boolean hasInsert() {
return operationCase_ == 4;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*
* @return The insert.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getInsert() {
if (insertBuilder_ == null) {
if (operationCase_ == 4) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
} else {
if (operationCase_ == 4) {
return insertBuilder_.getMessage();
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
public Builder setInsert(com.google.datastore.v1.Entity value) {
if (insertBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
insertBuilder_.setMessage(value);
}
operationCase_ = 4;
return this;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
public Builder setInsert(com.google.datastore.v1.Entity.Builder builderForValue) {
if (insertBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
insertBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 4;
return this;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
public Builder mergeInsert(com.google.datastore.v1.Entity value) {
if (insertBuilder_ == null) {
if (operationCase_ == 4
&& operation_ != com.google.datastore.v1.Entity.getDefaultInstance()) {
operation_ =
com.google.datastore.v1.Entity.newBuilder((com.google.datastore.v1.Entity) operation_)
.mergeFrom(value)
.buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 4) {
insertBuilder_.mergeFrom(value);
} else {
insertBuilder_.setMessage(value);
}
}
operationCase_ = 4;
return this;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
public Builder clearInsert() {
if (insertBuilder_ == null) {
if (operationCase_ == 4) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 4) {
operationCase_ = 0;
operation_ = null;
}
insertBuilder_.clear();
}
return this;
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
public com.google.datastore.v1.Entity.Builder getInsertBuilder() {
return getInsertFieldBuilder().getBuilder();
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getInsertOrBuilder() {
if ((operationCase_ == 4) && (insertBuilder_ != null)) {
return insertBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 4) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to insert. The entity must not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity insert = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
getInsertFieldBuilder() {
if (insertBuilder_ == null) {
if (!(operationCase_ == 4)) {
operation_ = com.google.datastore.v1.Entity.getDefaultInstance();
}
insertBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>(
(com.google.datastore.v1.Entity) operation_, getParentForChildren(), isClean());
operation_ = null;
}
operationCase_ = 4;
onChanged();
return insertBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
updateBuilder_;
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*
* @return Whether the update field is set.
*/
@java.lang.Override
public boolean hasUpdate() {
return operationCase_ == 5;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*
* @return The update.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getUpdate() {
if (updateBuilder_ == null) {
if (operationCase_ == 5) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
} else {
if (operationCase_ == 5) {
return updateBuilder_.getMessage();
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
public Builder setUpdate(com.google.datastore.v1.Entity value) {
if (updateBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
updateBuilder_.setMessage(value);
}
operationCase_ = 5;
return this;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
public Builder setUpdate(com.google.datastore.v1.Entity.Builder builderForValue) {
if (updateBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
updateBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 5;
return this;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
public Builder mergeUpdate(com.google.datastore.v1.Entity value) {
if (updateBuilder_ == null) {
if (operationCase_ == 5
&& operation_ != com.google.datastore.v1.Entity.getDefaultInstance()) {
operation_ =
com.google.datastore.v1.Entity.newBuilder((com.google.datastore.v1.Entity) operation_)
.mergeFrom(value)
.buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 5) {
updateBuilder_.mergeFrom(value);
} else {
updateBuilder_.setMessage(value);
}
}
operationCase_ = 5;
return this;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
public Builder clearUpdate() {
if (updateBuilder_ == null) {
if (operationCase_ == 5) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 5) {
operationCase_ = 0;
operation_ = null;
}
updateBuilder_.clear();
}
return this;
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
public com.google.datastore.v1.Entity.Builder getUpdateBuilder() {
return getUpdateFieldBuilder().getBuilder();
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getUpdateOrBuilder() {
if ((operationCase_ == 5) && (updateBuilder_ != null)) {
return updateBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 5) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to update. The entity must already exist.
* Must have a complete key path.
*
*
* .google.datastore.v1.Entity update = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
getUpdateFieldBuilder() {
if (updateBuilder_ == null) {
if (!(operationCase_ == 5)) {
operation_ = com.google.datastore.v1.Entity.getDefaultInstance();
}
updateBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>(
(com.google.datastore.v1.Entity) operation_, getParentForChildren(), isClean());
operation_ = null;
}
operationCase_ = 5;
onChanged();
return updateBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
upsertBuilder_;
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*
* @return Whether the upsert field is set.
*/
@java.lang.Override
public boolean hasUpsert() {
return operationCase_ == 6;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*
* @return The upsert.
*/
@java.lang.Override
public com.google.datastore.v1.Entity getUpsert() {
if (upsertBuilder_ == null) {
if (operationCase_ == 6) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
} else {
if (operationCase_ == 6) {
return upsertBuilder_.getMessage();
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
public Builder setUpsert(com.google.datastore.v1.Entity value) {
if (upsertBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
upsertBuilder_.setMessage(value);
}
operationCase_ = 6;
return this;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
public Builder setUpsert(com.google.datastore.v1.Entity.Builder builderForValue) {
if (upsertBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
upsertBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 6;
return this;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
public Builder mergeUpsert(com.google.datastore.v1.Entity value) {
if (upsertBuilder_ == null) {
if (operationCase_ == 6
&& operation_ != com.google.datastore.v1.Entity.getDefaultInstance()) {
operation_ =
com.google.datastore.v1.Entity.newBuilder((com.google.datastore.v1.Entity) operation_)
.mergeFrom(value)
.buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 6) {
upsertBuilder_.mergeFrom(value);
} else {
upsertBuilder_.setMessage(value);
}
}
operationCase_ = 6;
return this;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
public Builder clearUpsert() {
if (upsertBuilder_ == null) {
if (operationCase_ == 6) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 6) {
operationCase_ = 0;
operation_ = null;
}
upsertBuilder_.clear();
}
return this;
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
public com.google.datastore.v1.Entity.Builder getUpsertBuilder() {
return getUpsertFieldBuilder().getBuilder();
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
@java.lang.Override
public com.google.datastore.v1.EntityOrBuilder getUpsertOrBuilder() {
if ((operationCase_ == 6) && (upsertBuilder_ != null)) {
return upsertBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 6) {
return (com.google.datastore.v1.Entity) operation_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
*
*
* The entity to upsert. The entity may or may not already exist.
* The entity key's final path element may be incomplete.
*
*
* .google.datastore.v1.Entity upsert = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>
getUpsertFieldBuilder() {
if (upsertBuilder_ == null) {
if (!(operationCase_ == 6)) {
operation_ = com.google.datastore.v1.Entity.getDefaultInstance();
}
upsertBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity,
com.google.datastore.v1.Entity.Builder,
com.google.datastore.v1.EntityOrBuilder>(
(com.google.datastore.v1.Entity) operation_, getParentForChildren(), isClean());
operation_ = null;
}
operationCase_ = 6;
onChanged();
return upsertBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Key,
com.google.datastore.v1.Key.Builder,
com.google.datastore.v1.KeyOrBuilder>
deleteBuilder_;
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*
* @return Whether the delete field is set.
*/
@java.lang.Override
public boolean hasDelete() {
return operationCase_ == 7;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*
* @return The delete.
*/
@java.lang.Override
public com.google.datastore.v1.Key getDelete() {
if (deleteBuilder_ == null) {
if (operationCase_ == 7) {
return (com.google.datastore.v1.Key) operation_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
} else {
if (operationCase_ == 7) {
return deleteBuilder_.getMessage();
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
public Builder setDelete(com.google.datastore.v1.Key value) {
if (deleteBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
operation_ = value;
onChanged();
} else {
deleteBuilder_.setMessage(value);
}
operationCase_ = 7;
return this;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
public Builder setDelete(com.google.datastore.v1.Key.Builder builderForValue) {
if (deleteBuilder_ == null) {
operation_ = builderForValue.build();
onChanged();
} else {
deleteBuilder_.setMessage(builderForValue.build());
}
operationCase_ = 7;
return this;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
public Builder mergeDelete(com.google.datastore.v1.Key value) {
if (deleteBuilder_ == null) {
if (operationCase_ == 7 && operation_ != com.google.datastore.v1.Key.getDefaultInstance()) {
operation_ =
com.google.datastore.v1.Key.newBuilder((com.google.datastore.v1.Key) operation_)
.mergeFrom(value)
.buildPartial();
} else {
operation_ = value;
}
onChanged();
} else {
if (operationCase_ == 7) {
deleteBuilder_.mergeFrom(value);
} else {
deleteBuilder_.setMessage(value);
}
}
operationCase_ = 7;
return this;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
public Builder clearDelete() {
if (deleteBuilder_ == null) {
if (operationCase_ == 7) {
operationCase_ = 0;
operation_ = null;
onChanged();
}
} else {
if (operationCase_ == 7) {
operationCase_ = 0;
operation_ = null;
}
deleteBuilder_.clear();
}
return this;
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
public com.google.datastore.v1.Key.Builder getDeleteBuilder() {
return getDeleteFieldBuilder().getBuilder();
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
@java.lang.Override
public com.google.datastore.v1.KeyOrBuilder getDeleteOrBuilder() {
if ((operationCase_ == 7) && (deleteBuilder_ != null)) {
return deleteBuilder_.getMessageOrBuilder();
} else {
if (operationCase_ == 7) {
return (com.google.datastore.v1.Key) operation_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
}
/**
*
*
*
* The key of the entity to delete. The entity may or may not already exist.
* Must have a complete key path and must not be reserved/read-only.
*
*
* .google.datastore.v1.Key delete = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Key,
com.google.datastore.v1.Key.Builder,
com.google.datastore.v1.KeyOrBuilder>
getDeleteFieldBuilder() {
if (deleteBuilder_ == null) {
if (!(operationCase_ == 7)) {
operation_ = com.google.datastore.v1.Key.getDefaultInstance();
}
deleteBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Key,
com.google.datastore.v1.Key.Builder,
com.google.datastore.v1.KeyOrBuilder>(
(com.google.datastore.v1.Key) operation_, getParentForChildren(), isClean());
operation_ = null;
}
operationCase_ = 7;
onChanged();
return deleteBuilder_;
}
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @return Whether the baseVersion field is set.
*/
public boolean hasBaseVersion() {
return conflictDetectionStrategyCase_ == 8;
}
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @return The baseVersion.
*/
public long getBaseVersion() {
if (conflictDetectionStrategyCase_ == 8) {
return (java.lang.Long) conflictDetectionStrategy_;
}
return 0L;
}
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @param value The baseVersion to set.
* @return This builder for chaining.
*/
public Builder setBaseVersion(long value) {
conflictDetectionStrategyCase_ = 8;
conflictDetectionStrategy_ = value;
onChanged();
return this;
}
/**
*
*
*
* The version of the entity that this mutation is being applied
* to. If this does not match the current version on the server, the
* mutation conflicts.
*
*
* int64 base_version = 8;
*
* @return This builder for chaining.
*/
public Builder clearBaseVersion() {
if (conflictDetectionStrategyCase_ == 8) {
conflictDetectionStrategyCase_ = 0;
conflictDetectionStrategy_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
updateTimeBuilder_;
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*
* @return Whether the updateTime field is set.
*/
@java.lang.Override
public boolean hasUpdateTime() {
return conflictDetectionStrategyCase_ == 11;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*
* @return The updateTime.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getUpdateTime() {
if (updateTimeBuilder_ == null) {
if (conflictDetectionStrategyCase_ == 11) {
return (com.google.protobuf.Timestamp) conflictDetectionStrategy_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
} else {
if (conflictDetectionStrategyCase_ == 11) {
return updateTimeBuilder_.getMessage();
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
if (updateTimeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
conflictDetectionStrategy_ = value;
onChanged();
} else {
updateTimeBuilder_.setMessage(value);
}
conflictDetectionStrategyCase_ = 11;
return this;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) {
if (updateTimeBuilder_ == null) {
conflictDetectionStrategy_ = builderForValue.build();
onChanged();
} else {
updateTimeBuilder_.setMessage(builderForValue.build());
}
conflictDetectionStrategyCase_ = 11;
return this;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
if (updateTimeBuilder_ == null) {
if (conflictDetectionStrategyCase_ == 11
&& conflictDetectionStrategy_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
conflictDetectionStrategy_ =
com.google.protobuf.Timestamp.newBuilder(
(com.google.protobuf.Timestamp) conflictDetectionStrategy_)
.mergeFrom(value)
.buildPartial();
} else {
conflictDetectionStrategy_ = value;
}
onChanged();
} else {
if (conflictDetectionStrategyCase_ == 11) {
updateTimeBuilder_.mergeFrom(value);
} else {
updateTimeBuilder_.setMessage(value);
}
}
conflictDetectionStrategyCase_ = 11;
return this;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
public Builder clearUpdateTime() {
if (updateTimeBuilder_ == null) {
if (conflictDetectionStrategyCase_ == 11) {
conflictDetectionStrategyCase_ = 0;
conflictDetectionStrategy_ = null;
onChanged();
}
} else {
if (conflictDetectionStrategyCase_ == 11) {
conflictDetectionStrategyCase_ = 0;
conflictDetectionStrategy_ = null;
}
updateTimeBuilder_.clear();
}
return this;
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() {
return getUpdateTimeFieldBuilder().getBuilder();
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() {
if ((conflictDetectionStrategyCase_ == 11) && (updateTimeBuilder_ != null)) {
return updateTimeBuilder_.getMessageOrBuilder();
} else {
if (conflictDetectionStrategyCase_ == 11) {
return (com.google.protobuf.Timestamp) conflictDetectionStrategy_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
*
*
* The update time of the entity that this mutation is being applied
* to. If this does not match the current update time on the server, the
* mutation conflicts.
*
*
* .google.protobuf.Timestamp update_time = 11;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getUpdateTimeFieldBuilder() {
if (updateTimeBuilder_ == null) {
if (!(conflictDetectionStrategyCase_ == 11)) {
conflictDetectionStrategy_ = com.google.protobuf.Timestamp.getDefaultInstance();
}
updateTimeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
(com.google.protobuf.Timestamp) conflictDetectionStrategy_,
getParentForChildren(),
isClean());
conflictDetectionStrategy_ = null;
}
conflictDetectionStrategyCase_ = 11;
onChanged();
return updateTimeBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.datastore.v1.Mutation)
}
// @@protoc_insertion_point(class_scope:google.datastore.v1.Mutation)
private static final com.google.datastore.v1.Mutation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.datastore.v1.Mutation();
}
public static com.google.datastore.v1.Mutation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Mutation parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.datastore.v1.Mutation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy