com.google.datastore.v1.Value Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datastore-v1-protos Show documentation
Show all versions of datastore-v1-protos Show documentation
Protocol buffers for accessing the Google Cloud Datastore API.
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/datastore/v1/entity.proto
package com.google.datastore.v1;
/**
*
* A message that can hold any of the supported value types and associated
* metadata.
*
*
* Protobuf type {@code google.datastore.v1.Value}
*/
public final class Value extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.datastore.v1.Value)
ValueOrBuilder {
// Use Value.newBuilder() to construct.
private Value(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Value() {
meaning_ = 0;
excludeFromIndexes_ = false;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Value(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
valueTypeCase_ = 1;
valueType_ = input.readBool();
break;
}
case 16: {
valueTypeCase_ = 2;
valueType_ = input.readInt64();
break;
}
case 25: {
valueTypeCase_ = 3;
valueType_ = input.readDouble();
break;
}
case 42: {
com.google.datastore.v1.Key.Builder subBuilder = null;
if (valueTypeCase_ == 5) {
subBuilder = ((com.google.datastore.v1.Key) valueType_).toBuilder();
}
valueType_ =
input.readMessage(com.google.datastore.v1.Key.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.datastore.v1.Key) valueType_);
valueType_ = subBuilder.buildPartial();
}
valueTypeCase_ = 5;
break;
}
case 50: {
com.google.datastore.v1.Entity.Builder subBuilder = null;
if (valueTypeCase_ == 6) {
subBuilder = ((com.google.datastore.v1.Entity) valueType_).toBuilder();
}
valueType_ =
input.readMessage(com.google.datastore.v1.Entity.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.datastore.v1.Entity) valueType_);
valueType_ = subBuilder.buildPartial();
}
valueTypeCase_ = 6;
break;
}
case 66: {
com.google.type.LatLng.Builder subBuilder = null;
if (valueTypeCase_ == 8) {
subBuilder = ((com.google.type.LatLng) valueType_).toBuilder();
}
valueType_ =
input.readMessage(com.google.type.LatLng.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.type.LatLng) valueType_);
valueType_ = subBuilder.buildPartial();
}
valueTypeCase_ = 8;
break;
}
case 74: {
com.google.datastore.v1.ArrayValue.Builder subBuilder = null;
if (valueTypeCase_ == 9) {
subBuilder = ((com.google.datastore.v1.ArrayValue) valueType_).toBuilder();
}
valueType_ =
input.readMessage(com.google.datastore.v1.ArrayValue.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.datastore.v1.ArrayValue) valueType_);
valueType_ = subBuilder.buildPartial();
}
valueTypeCase_ = 9;
break;
}
case 82: {
com.google.protobuf.Timestamp.Builder subBuilder = null;
if (valueTypeCase_ == 10) {
subBuilder = ((com.google.protobuf.Timestamp) valueType_).toBuilder();
}
valueType_ =
input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.google.protobuf.Timestamp) valueType_);
valueType_ = subBuilder.buildPartial();
}
valueTypeCase_ = 10;
break;
}
case 88: {
int rawValue = input.readEnum();
valueTypeCase_ = 11;
valueType_ = rawValue;
break;
}
case 112: {
meaning_ = input.readInt32();
break;
}
case 138: {
java.lang.String s = input.readStringRequireUtf8();
valueTypeCase_ = 17;
valueType_ = s;
break;
}
case 146: {
valueTypeCase_ = 18;
valueType_ = input.readBytes();
break;
}
case 152: {
excludeFromIndexes_ = input.readBool();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.Value.class, com.google.datastore.v1.Value.Builder.class);
}
private int valueTypeCase_ = 0;
private java.lang.Object valueType_;
public enum ValueTypeCase
implements com.google.protobuf.Internal.EnumLite {
NULL_VALUE(11),
BOOLEAN_VALUE(1),
INTEGER_VALUE(2),
DOUBLE_VALUE(3),
TIMESTAMP_VALUE(10),
KEY_VALUE(5),
STRING_VALUE(17),
BLOB_VALUE(18),
GEO_POINT_VALUE(8),
ENTITY_VALUE(6),
ARRAY_VALUE(9),
VALUETYPE_NOT_SET(0);
private final int value;
private ValueTypeCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static ValueTypeCase valueOf(int value) {
return forNumber(value);
}
public static ValueTypeCase forNumber(int value) {
switch (value) {
case 11: return NULL_VALUE;
case 1: return BOOLEAN_VALUE;
case 2: return INTEGER_VALUE;
case 3: return DOUBLE_VALUE;
case 10: return TIMESTAMP_VALUE;
case 5: return KEY_VALUE;
case 17: return STRING_VALUE;
case 18: return BLOB_VALUE;
case 8: return GEO_POINT_VALUE;
case 6: return ENTITY_VALUE;
case 9: return ARRAY_VALUE;
case 0: return VALUETYPE_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public ValueTypeCase
getValueTypeCase() {
return ValueTypeCase.forNumber(
valueTypeCase_);
}
public static final int NULL_VALUE_FIELD_NUMBER = 11;
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public int getNullValueValue() {
if (valueTypeCase_ == 11) {
return (java.lang.Integer) valueType_;
}
return 0;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public com.google.protobuf.NullValue getNullValue() {
if (valueTypeCase_ == 11) {
com.google.protobuf.NullValue result = com.google.protobuf.NullValue.valueOf(
(java.lang.Integer) valueType_);
return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result;
}
return com.google.protobuf.NullValue.NULL_VALUE;
}
public static final int BOOLEAN_VALUE_FIELD_NUMBER = 1;
/**
*
* A boolean value.
*
*
* optional bool boolean_value = 1;
*/
public boolean getBooleanValue() {
if (valueTypeCase_ == 1) {
return (java.lang.Boolean) valueType_;
}
return false;
}
public static final int INTEGER_VALUE_FIELD_NUMBER = 2;
/**
*
* An integer value.
*
*
* optional int64 integer_value = 2;
*/
public long getIntegerValue() {
if (valueTypeCase_ == 2) {
return (java.lang.Long) valueType_;
}
return 0L;
}
public static final int DOUBLE_VALUE_FIELD_NUMBER = 3;
/**
*
* A double value.
*
*
* optional double double_value = 3;
*/
public double getDoubleValue() {
if (valueTypeCase_ == 3) {
return (java.lang.Double) valueType_;
}
return 0D;
}
public static final int TIMESTAMP_VALUE_FIELD_NUMBER = 10;
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public com.google.protobuf.Timestamp getTimestampValue() {
if (valueTypeCase_ == 10) {
return (com.google.protobuf.Timestamp) valueType_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() {
if (valueTypeCase_ == 10) {
return (com.google.protobuf.Timestamp) valueType_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
public static final int KEY_VALUE_FIELD_NUMBER = 5;
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public com.google.datastore.v1.Key getKeyValue() {
if (valueTypeCase_ == 5) {
return (com.google.datastore.v1.Key) valueType_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public com.google.datastore.v1.KeyOrBuilder getKeyValueOrBuilder() {
if (valueTypeCase_ == 5) {
return (com.google.datastore.v1.Key) valueType_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
public static final int STRING_VALUE_FIELD_NUMBER = 17;
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public java.lang.String getStringValue() {
java.lang.Object ref = "";
if (valueTypeCase_ == 17) {
ref = valueType_;
}
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (valueTypeCase_ == 17) {
valueType_ = s;
}
return s;
}
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public com.google.protobuf.ByteString
getStringValueBytes() {
java.lang.Object ref = "";
if (valueTypeCase_ == 17) {
ref = valueType_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (valueTypeCase_ == 17) {
valueType_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BLOB_VALUE_FIELD_NUMBER = 18;
/**
*
* A blob value.
* May have at most 1,000,000 bytes.
* When `exclude_from_indexes` is false, may have at most 1500 bytes.
* In JSON requests, must be base64-encoded.
*
*
* optional bytes blob_value = 18;
*/
public com.google.protobuf.ByteString getBlobValue() {
if (valueTypeCase_ == 18) {
return (com.google.protobuf.ByteString) valueType_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int GEO_POINT_VALUE_FIELD_NUMBER = 8;
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public com.google.type.LatLng getGeoPointValue() {
if (valueTypeCase_ == 8) {
return (com.google.type.LatLng) valueType_;
}
return com.google.type.LatLng.getDefaultInstance();
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() {
if (valueTypeCase_ == 8) {
return (com.google.type.LatLng) valueType_;
}
return com.google.type.LatLng.getDefaultInstance();
}
public static final int ENTITY_VALUE_FIELD_NUMBER = 6;
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public com.google.datastore.v1.Entity getEntityValue() {
if (valueTypeCase_ == 6) {
return (com.google.datastore.v1.Entity) valueType_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public com.google.datastore.v1.EntityOrBuilder getEntityValueOrBuilder() {
if (valueTypeCase_ == 6) {
return (com.google.datastore.v1.Entity) valueType_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
public static final int ARRAY_VALUE_FIELD_NUMBER = 9;
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public com.google.datastore.v1.ArrayValue getArrayValue() {
if (valueTypeCase_ == 9) {
return (com.google.datastore.v1.ArrayValue) valueType_;
}
return com.google.datastore.v1.ArrayValue.getDefaultInstance();
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public com.google.datastore.v1.ArrayValueOrBuilder getArrayValueOrBuilder() {
if (valueTypeCase_ == 9) {
return (com.google.datastore.v1.ArrayValue) valueType_;
}
return com.google.datastore.v1.ArrayValue.getDefaultInstance();
}
public static final int MEANING_FIELD_NUMBER = 14;
private int meaning_;
/**
*
* The `meaning` field should only be populated for backwards compatibility.
*
*
* optional int32 meaning = 14;
*/
public int getMeaning() {
return meaning_;
}
public static final int EXCLUDE_FROM_INDEXES_FIELD_NUMBER = 19;
private boolean excludeFromIndexes_;
/**
*
* If the value should be excluded from all indexes including those defined
* explicitly.
*
*
* optional bool exclude_from_indexes = 19;
*/
public boolean getExcludeFromIndexes() {
return excludeFromIndexes_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (valueTypeCase_ == 1) {
output.writeBool(
1, (boolean)((java.lang.Boolean) valueType_));
}
if (valueTypeCase_ == 2) {
output.writeInt64(
2, (long)((java.lang.Long) valueType_));
}
if (valueTypeCase_ == 3) {
output.writeDouble(
3, (double)((java.lang.Double) valueType_));
}
if (valueTypeCase_ == 5) {
output.writeMessage(5, (com.google.datastore.v1.Key) valueType_);
}
if (valueTypeCase_ == 6) {
output.writeMessage(6, (com.google.datastore.v1.Entity) valueType_);
}
if (valueTypeCase_ == 8) {
output.writeMessage(8, (com.google.type.LatLng) valueType_);
}
if (valueTypeCase_ == 9) {
output.writeMessage(9, (com.google.datastore.v1.ArrayValue) valueType_);
}
if (valueTypeCase_ == 10) {
output.writeMessage(10, (com.google.protobuf.Timestamp) valueType_);
}
if (valueTypeCase_ == 11) {
output.writeEnum(11, ((java.lang.Integer) valueType_));
}
if (meaning_ != 0) {
output.writeInt32(14, meaning_);
}
if (valueTypeCase_ == 17) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 17, valueType_);
}
if (valueTypeCase_ == 18) {
output.writeBytes(
18, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) valueType_));
}
if (excludeFromIndexes_ != false) {
output.writeBool(19, excludeFromIndexes_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (valueTypeCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
1, (boolean)((java.lang.Boolean) valueType_));
}
if (valueTypeCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeInt64Size(
2, (long)((java.lang.Long) valueType_));
}
if (valueTypeCase_ == 3) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(
3, (double)((java.lang.Double) valueType_));
}
if (valueTypeCase_ == 5) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, (com.google.datastore.v1.Key) valueType_);
}
if (valueTypeCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, (com.google.datastore.v1.Entity) valueType_);
}
if (valueTypeCase_ == 8) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(8, (com.google.type.LatLng) valueType_);
}
if (valueTypeCase_ == 9) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(9, (com.google.datastore.v1.ArrayValue) valueType_);
}
if (valueTypeCase_ == 10) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(10, (com.google.protobuf.Timestamp) valueType_);
}
if (valueTypeCase_ == 11) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(11, ((java.lang.Integer) valueType_));
}
if (meaning_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(14, meaning_);
}
if (valueTypeCase_ == 17) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, valueType_);
}
if (valueTypeCase_ == 18) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(
18, (com.google.protobuf.ByteString)((com.google.protobuf.ByteString) valueType_));
}
if (excludeFromIndexes_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(19, excludeFromIndexes_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.datastore.v1.Value)) {
return super.equals(obj);
}
com.google.datastore.v1.Value other = (com.google.datastore.v1.Value) obj;
boolean result = true;
result = result && (getMeaning()
== other.getMeaning());
result = result && (getExcludeFromIndexes()
== other.getExcludeFromIndexes());
result = result && getValueTypeCase().equals(
other.getValueTypeCase());
if (!result) return false;
switch (valueTypeCase_) {
case 11:
result = result && getNullValueValue()
== other.getNullValueValue();
break;
case 1:
result = result && (getBooleanValue()
== other.getBooleanValue());
break;
case 2:
result = result && (getIntegerValue()
== other.getIntegerValue());
break;
case 3:
result = result && (
java.lang.Double.doubleToLongBits(getDoubleValue())
== java.lang.Double.doubleToLongBits(
other.getDoubleValue()));
break;
case 10:
result = result && getTimestampValue()
.equals(other.getTimestampValue());
break;
case 5:
result = result && getKeyValue()
.equals(other.getKeyValue());
break;
case 17:
result = result && getStringValue()
.equals(other.getStringValue());
break;
case 18:
result = result && getBlobValue()
.equals(other.getBlobValue());
break;
case 8:
result = result && getGeoPointValue()
.equals(other.getGeoPointValue());
break;
case 6:
result = result && getEntityValue()
.equals(other.getEntityValue());
break;
case 9:
result = result && getArrayValue()
.equals(other.getArrayValue());
break;
case 0:
default:
}
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptorForType().hashCode();
hash = (37 * hash) + MEANING_FIELD_NUMBER;
hash = (53 * hash) + getMeaning();
hash = (37 * hash) + EXCLUDE_FROM_INDEXES_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getExcludeFromIndexes());
switch (valueTypeCase_) {
case 11:
hash = (37 * hash) + NULL_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getNullValueValue();
break;
case 1:
hash = (37 * hash) + BOOLEAN_VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getBooleanValue());
break;
case 2:
hash = (37 * hash) + INTEGER_VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
getIntegerValue());
break;
case 3:
hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getDoubleValue()));
break;
case 10:
hash = (37 * hash) + TIMESTAMP_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getTimestampValue().hashCode();
break;
case 5:
hash = (37 * hash) + KEY_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getKeyValue().hashCode();
break;
case 17:
hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getStringValue().hashCode();
break;
case 18:
hash = (37 * hash) + BLOB_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getBlobValue().hashCode();
break;
case 8:
hash = (37 * hash) + GEO_POINT_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getGeoPointValue().hashCode();
break;
case 6:
hash = (37 * hash) + ENTITY_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getEntityValue().hashCode();
break;
case 9:
hash = (37 * hash) + ARRAY_VALUE_FIELD_NUMBER;
hash = (53 * hash) + getArrayValue().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.datastore.v1.Value parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.Value 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.Value parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.datastore.v1.Value parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.datastore.v1.Value parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Value 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.Value parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Value 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.Value parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.datastore.v1.Value parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.datastore.v1.Value prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
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 message that can hold any of the supported value types and associated
* metadata.
*
*
* Protobuf type {@code google.datastore.v1.Value}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.datastore.v1.Value)
com.google.datastore.v1.ValueOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.datastore.v1.Value.class, com.google.datastore.v1.Value.Builder.class);
}
// Construct using com.google.datastore.v1.Value.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
meaning_ = 0;
excludeFromIndexes_ = false;
valueTypeCase_ = 0;
valueType_ = null;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.datastore.v1.EntityProto.internal_static_google_datastore_v1_Value_descriptor;
}
public com.google.datastore.v1.Value getDefaultInstanceForType() {
return com.google.datastore.v1.Value.getDefaultInstance();
}
public com.google.datastore.v1.Value build() {
com.google.datastore.v1.Value result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.datastore.v1.Value buildPartial() {
com.google.datastore.v1.Value result = new com.google.datastore.v1.Value(this);
if (valueTypeCase_ == 11) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 1) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 2) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 3) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 10) {
if (timestampValueBuilder_ == null) {
result.valueType_ = valueType_;
} else {
result.valueType_ = timestampValueBuilder_.build();
}
}
if (valueTypeCase_ == 5) {
if (keyValueBuilder_ == null) {
result.valueType_ = valueType_;
} else {
result.valueType_ = keyValueBuilder_.build();
}
}
if (valueTypeCase_ == 17) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 18) {
result.valueType_ = valueType_;
}
if (valueTypeCase_ == 8) {
if (geoPointValueBuilder_ == null) {
result.valueType_ = valueType_;
} else {
result.valueType_ = geoPointValueBuilder_.build();
}
}
if (valueTypeCase_ == 6) {
if (entityValueBuilder_ == null) {
result.valueType_ = valueType_;
} else {
result.valueType_ = entityValueBuilder_.build();
}
}
if (valueTypeCase_ == 9) {
if (arrayValueBuilder_ == null) {
result.valueType_ = valueType_;
} else {
result.valueType_ = arrayValueBuilder_.build();
}
}
result.meaning_ = meaning_;
result.excludeFromIndexes_ = excludeFromIndexes_;
result.valueTypeCase_ = valueTypeCase_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.datastore.v1.Value) {
return mergeFrom((com.google.datastore.v1.Value)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.datastore.v1.Value other) {
if (other == com.google.datastore.v1.Value.getDefaultInstance()) return this;
if (other.getMeaning() != 0) {
setMeaning(other.getMeaning());
}
if (other.getExcludeFromIndexes() != false) {
setExcludeFromIndexes(other.getExcludeFromIndexes());
}
switch (other.getValueTypeCase()) {
case NULL_VALUE: {
setNullValueValue(other.getNullValueValue());
break;
}
case BOOLEAN_VALUE: {
setBooleanValue(other.getBooleanValue());
break;
}
case INTEGER_VALUE: {
setIntegerValue(other.getIntegerValue());
break;
}
case DOUBLE_VALUE: {
setDoubleValue(other.getDoubleValue());
break;
}
case TIMESTAMP_VALUE: {
mergeTimestampValue(other.getTimestampValue());
break;
}
case KEY_VALUE: {
mergeKeyValue(other.getKeyValue());
break;
}
case STRING_VALUE: {
valueTypeCase_ = 17;
valueType_ = other.valueType_;
onChanged();
break;
}
case BLOB_VALUE: {
setBlobValue(other.getBlobValue());
break;
}
case GEO_POINT_VALUE: {
mergeGeoPointValue(other.getGeoPointValue());
break;
}
case ENTITY_VALUE: {
mergeEntityValue(other.getEntityValue());
break;
}
case ARRAY_VALUE: {
mergeArrayValue(other.getArrayValue());
break;
}
case VALUETYPE_NOT_SET: {
break;
}
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.datastore.v1.Value parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.datastore.v1.Value) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int valueTypeCase_ = 0;
private java.lang.Object valueType_;
public ValueTypeCase
getValueTypeCase() {
return ValueTypeCase.forNumber(
valueTypeCase_);
}
public Builder clearValueType() {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
return this;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public int getNullValueValue() {
if (valueTypeCase_ == 11) {
return ((java.lang.Integer) valueType_).intValue();
}
return 0;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public Builder setNullValueValue(int value) {
valueTypeCase_ = 11;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public com.google.protobuf.NullValue getNullValue() {
if (valueTypeCase_ == 11) {
com.google.protobuf.NullValue result = com.google.protobuf.NullValue.valueOf(
(java.lang.Integer) valueType_);
return result == null ? com.google.protobuf.NullValue.UNRECOGNIZED : result;
}
return com.google.protobuf.NullValue.NULL_VALUE;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public Builder setNullValue(com.google.protobuf.NullValue value) {
if (value == null) {
throw new NullPointerException();
}
valueTypeCase_ = 11;
valueType_ = value.getNumber();
onChanged();
return this;
}
/**
*
* A null value.
*
*
* optional .google.protobuf.NullValue null_value = 11;
*/
public Builder clearNullValue() {
if (valueTypeCase_ == 11) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
/**
*
* A boolean value.
*
*
* optional bool boolean_value = 1;
*/
public boolean getBooleanValue() {
if (valueTypeCase_ == 1) {
return (java.lang.Boolean) valueType_;
}
return false;
}
/**
*
* A boolean value.
*
*
* optional bool boolean_value = 1;
*/
public Builder setBooleanValue(boolean value) {
valueTypeCase_ = 1;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A boolean value.
*
*
* optional bool boolean_value = 1;
*/
public Builder clearBooleanValue() {
if (valueTypeCase_ == 1) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
/**
*
* An integer value.
*
*
* optional int64 integer_value = 2;
*/
public long getIntegerValue() {
if (valueTypeCase_ == 2) {
return (java.lang.Long) valueType_;
}
return 0L;
}
/**
*
* An integer value.
*
*
* optional int64 integer_value = 2;
*/
public Builder setIntegerValue(long value) {
valueTypeCase_ = 2;
valueType_ = value;
onChanged();
return this;
}
/**
*
* An integer value.
*
*
* optional int64 integer_value = 2;
*/
public Builder clearIntegerValue() {
if (valueTypeCase_ == 2) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
/**
*
* A double value.
*
*
* optional double double_value = 3;
*/
public double getDoubleValue() {
if (valueTypeCase_ == 3) {
return (java.lang.Double) valueType_;
}
return 0D;
}
/**
*
* A double value.
*
*
* optional double double_value = 3;
*/
public Builder setDoubleValue(double value) {
valueTypeCase_ = 3;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A double value.
*
*
* optional double double_value = 3;
*/
public Builder clearDoubleValue() {
if (valueTypeCase_ == 3) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timestampValueBuilder_;
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public com.google.protobuf.Timestamp getTimestampValue() {
if (timestampValueBuilder_ == null) {
if (valueTypeCase_ == 10) {
return (com.google.protobuf.Timestamp) valueType_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
} else {
if (valueTypeCase_ == 10) {
return timestampValueBuilder_.getMessage();
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public Builder setTimestampValue(com.google.protobuf.Timestamp value) {
if (timestampValueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value;
onChanged();
} else {
timestampValueBuilder_.setMessage(value);
}
valueTypeCase_ = 10;
return this;
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public Builder setTimestampValue(
com.google.protobuf.Timestamp.Builder builderForValue) {
if (timestampValueBuilder_ == null) {
valueType_ = builderForValue.build();
onChanged();
} else {
timestampValueBuilder_.setMessage(builderForValue.build());
}
valueTypeCase_ = 10;
return this;
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public Builder mergeTimestampValue(com.google.protobuf.Timestamp value) {
if (timestampValueBuilder_ == null) {
if (valueTypeCase_ == 10 &&
valueType_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
valueType_ = com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) valueType_)
.mergeFrom(value).buildPartial();
} else {
valueType_ = value;
}
onChanged();
} else {
if (valueTypeCase_ == 10) {
timestampValueBuilder_.mergeFrom(value);
}
timestampValueBuilder_.setMessage(value);
}
valueTypeCase_ = 10;
return this;
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public Builder clearTimestampValue() {
if (timestampValueBuilder_ == null) {
if (valueTypeCase_ == 10) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
} else {
if (valueTypeCase_ == 10) {
valueTypeCase_ = 0;
valueType_ = null;
}
timestampValueBuilder_.clear();
}
return this;
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public com.google.protobuf.Timestamp.Builder getTimestampValueBuilder() {
return getTimestampValueFieldBuilder().getBuilder();
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
public com.google.protobuf.TimestampOrBuilder getTimestampValueOrBuilder() {
if ((valueTypeCase_ == 10) && (timestampValueBuilder_ != null)) {
return timestampValueBuilder_.getMessageOrBuilder();
} else {
if (valueTypeCase_ == 10) {
return (com.google.protobuf.Timestamp) valueType_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
* A timestamp value.
* When stored in the Datastore, precise only to microseconds;
* any additional precision is rounded down.
*
*
* optional .google.protobuf.Timestamp timestamp_value = 10;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
getTimestampValueFieldBuilder() {
if (timestampValueBuilder_ == null) {
if (!(valueTypeCase_ == 10)) {
valueType_ = com.google.protobuf.Timestamp.getDefaultInstance();
}
timestampValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
(com.google.protobuf.Timestamp) valueType_,
getParentForChildren(),
isClean());
valueType_ = null;
}
valueTypeCase_ = 10;
onChanged();;
return timestampValueBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Key, com.google.datastore.v1.Key.Builder, com.google.datastore.v1.KeyOrBuilder> keyValueBuilder_;
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public com.google.datastore.v1.Key getKeyValue() {
if (keyValueBuilder_ == null) {
if (valueTypeCase_ == 5) {
return (com.google.datastore.v1.Key) valueType_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
} else {
if (valueTypeCase_ == 5) {
return keyValueBuilder_.getMessage();
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public Builder setKeyValue(com.google.datastore.v1.Key value) {
if (keyValueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value;
onChanged();
} else {
keyValueBuilder_.setMessage(value);
}
valueTypeCase_ = 5;
return this;
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public Builder setKeyValue(
com.google.datastore.v1.Key.Builder builderForValue) {
if (keyValueBuilder_ == null) {
valueType_ = builderForValue.build();
onChanged();
} else {
keyValueBuilder_.setMessage(builderForValue.build());
}
valueTypeCase_ = 5;
return this;
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public Builder mergeKeyValue(com.google.datastore.v1.Key value) {
if (keyValueBuilder_ == null) {
if (valueTypeCase_ == 5 &&
valueType_ != com.google.datastore.v1.Key.getDefaultInstance()) {
valueType_ = com.google.datastore.v1.Key.newBuilder((com.google.datastore.v1.Key) valueType_)
.mergeFrom(value).buildPartial();
} else {
valueType_ = value;
}
onChanged();
} else {
if (valueTypeCase_ == 5) {
keyValueBuilder_.mergeFrom(value);
}
keyValueBuilder_.setMessage(value);
}
valueTypeCase_ = 5;
return this;
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public Builder clearKeyValue() {
if (keyValueBuilder_ == null) {
if (valueTypeCase_ == 5) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
} else {
if (valueTypeCase_ == 5) {
valueTypeCase_ = 0;
valueType_ = null;
}
keyValueBuilder_.clear();
}
return this;
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public com.google.datastore.v1.Key.Builder getKeyValueBuilder() {
return getKeyValueFieldBuilder().getBuilder();
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
public com.google.datastore.v1.KeyOrBuilder getKeyValueOrBuilder() {
if ((valueTypeCase_ == 5) && (keyValueBuilder_ != null)) {
return keyValueBuilder_.getMessageOrBuilder();
} else {
if (valueTypeCase_ == 5) {
return (com.google.datastore.v1.Key) valueType_;
}
return com.google.datastore.v1.Key.getDefaultInstance();
}
}
/**
*
* A key value.
*
*
* optional .google.datastore.v1.Key key_value = 5;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Key, com.google.datastore.v1.Key.Builder, com.google.datastore.v1.KeyOrBuilder>
getKeyValueFieldBuilder() {
if (keyValueBuilder_ == null) {
if (!(valueTypeCase_ == 5)) {
valueType_ = com.google.datastore.v1.Key.getDefaultInstance();
}
keyValueBuilder_ = 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) valueType_,
getParentForChildren(),
isClean());
valueType_ = null;
}
valueTypeCase_ = 5;
onChanged();;
return keyValueBuilder_;
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public java.lang.String getStringValue() {
java.lang.Object ref = "";
if (valueTypeCase_ == 17) {
ref = valueType_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (valueTypeCase_ == 17) {
valueType_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public com.google.protobuf.ByteString
getStringValueBytes() {
java.lang.Object ref = "";
if (valueTypeCase_ == 17) {
ref = valueType_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (valueTypeCase_ == 17) {
valueType_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public Builder setStringValue(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
valueTypeCase_ = 17;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public Builder clearStringValue() {
if (valueTypeCase_ == 17) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
/**
*
* A UTF-8 encoded string value.
* When `exclude_from_indexes` is false (it is indexed) , may have at most 1500 bytes.
* Otherwise, may be set to at least 1,000,000 bytes.
*
*
* optional string string_value = 17;
*/
public Builder setStringValueBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
valueTypeCase_ = 17;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A blob value.
* May have at most 1,000,000 bytes.
* When `exclude_from_indexes` is false, may have at most 1500 bytes.
* In JSON requests, must be base64-encoded.
*
*
* optional bytes blob_value = 18;
*/
public com.google.protobuf.ByteString getBlobValue() {
if (valueTypeCase_ == 18) {
return (com.google.protobuf.ByteString) valueType_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
* A blob value.
* May have at most 1,000,000 bytes.
* When `exclude_from_indexes` is false, may have at most 1500 bytes.
* In JSON requests, must be base64-encoded.
*
*
* optional bytes blob_value = 18;
*/
public Builder setBlobValue(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
valueTypeCase_ = 18;
valueType_ = value;
onChanged();
return this;
}
/**
*
* A blob value.
* May have at most 1,000,000 bytes.
* When `exclude_from_indexes` is false, may have at most 1500 bytes.
* In JSON requests, must be base64-encoded.
*
*
* optional bytes blob_value = 18;
*/
public Builder clearBlobValue() {
if (valueTypeCase_ == 18) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder> geoPointValueBuilder_;
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public com.google.type.LatLng getGeoPointValue() {
if (geoPointValueBuilder_ == null) {
if (valueTypeCase_ == 8) {
return (com.google.type.LatLng) valueType_;
}
return com.google.type.LatLng.getDefaultInstance();
} else {
if (valueTypeCase_ == 8) {
return geoPointValueBuilder_.getMessage();
}
return com.google.type.LatLng.getDefaultInstance();
}
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public Builder setGeoPointValue(com.google.type.LatLng value) {
if (geoPointValueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value;
onChanged();
} else {
geoPointValueBuilder_.setMessage(value);
}
valueTypeCase_ = 8;
return this;
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public Builder setGeoPointValue(
com.google.type.LatLng.Builder builderForValue) {
if (geoPointValueBuilder_ == null) {
valueType_ = builderForValue.build();
onChanged();
} else {
geoPointValueBuilder_.setMessage(builderForValue.build());
}
valueTypeCase_ = 8;
return this;
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public Builder mergeGeoPointValue(com.google.type.LatLng value) {
if (geoPointValueBuilder_ == null) {
if (valueTypeCase_ == 8 &&
valueType_ != com.google.type.LatLng.getDefaultInstance()) {
valueType_ = com.google.type.LatLng.newBuilder((com.google.type.LatLng) valueType_)
.mergeFrom(value).buildPartial();
} else {
valueType_ = value;
}
onChanged();
} else {
if (valueTypeCase_ == 8) {
geoPointValueBuilder_.mergeFrom(value);
}
geoPointValueBuilder_.setMessage(value);
}
valueTypeCase_ = 8;
return this;
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public Builder clearGeoPointValue() {
if (geoPointValueBuilder_ == null) {
if (valueTypeCase_ == 8) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
} else {
if (valueTypeCase_ == 8) {
valueTypeCase_ = 0;
valueType_ = null;
}
geoPointValueBuilder_.clear();
}
return this;
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public com.google.type.LatLng.Builder getGeoPointValueBuilder() {
return getGeoPointValueFieldBuilder().getBuilder();
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
public com.google.type.LatLngOrBuilder getGeoPointValueOrBuilder() {
if ((valueTypeCase_ == 8) && (geoPointValueBuilder_ != null)) {
return geoPointValueBuilder_.getMessageOrBuilder();
} else {
if (valueTypeCase_ == 8) {
return (com.google.type.LatLng) valueType_;
}
return com.google.type.LatLng.getDefaultInstance();
}
}
/**
*
* A geo point value representing a point on the surface of Earth.
*
*
* optional .google.type.LatLng geo_point_value = 8;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>
getGeoPointValueFieldBuilder() {
if (geoPointValueBuilder_ == null) {
if (!(valueTypeCase_ == 8)) {
valueType_ = com.google.type.LatLng.getDefaultInstance();
}
geoPointValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.LatLng, com.google.type.LatLng.Builder, com.google.type.LatLngOrBuilder>(
(com.google.type.LatLng) valueType_,
getParentForChildren(),
isClean());
valueType_ = null;
}
valueTypeCase_ = 8;
onChanged();;
return geoPointValueBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity, com.google.datastore.v1.Entity.Builder, com.google.datastore.v1.EntityOrBuilder> entityValueBuilder_;
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public com.google.datastore.v1.Entity getEntityValue() {
if (entityValueBuilder_ == null) {
if (valueTypeCase_ == 6) {
return (com.google.datastore.v1.Entity) valueType_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
} else {
if (valueTypeCase_ == 6) {
return entityValueBuilder_.getMessage();
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public Builder setEntityValue(com.google.datastore.v1.Entity value) {
if (entityValueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value;
onChanged();
} else {
entityValueBuilder_.setMessage(value);
}
valueTypeCase_ = 6;
return this;
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public Builder setEntityValue(
com.google.datastore.v1.Entity.Builder builderForValue) {
if (entityValueBuilder_ == null) {
valueType_ = builderForValue.build();
onChanged();
} else {
entityValueBuilder_.setMessage(builderForValue.build());
}
valueTypeCase_ = 6;
return this;
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public Builder mergeEntityValue(com.google.datastore.v1.Entity value) {
if (entityValueBuilder_ == null) {
if (valueTypeCase_ == 6 &&
valueType_ != com.google.datastore.v1.Entity.getDefaultInstance()) {
valueType_ = com.google.datastore.v1.Entity.newBuilder((com.google.datastore.v1.Entity) valueType_)
.mergeFrom(value).buildPartial();
} else {
valueType_ = value;
}
onChanged();
} else {
if (valueTypeCase_ == 6) {
entityValueBuilder_.mergeFrom(value);
}
entityValueBuilder_.setMessage(value);
}
valueTypeCase_ = 6;
return this;
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public Builder clearEntityValue() {
if (entityValueBuilder_ == null) {
if (valueTypeCase_ == 6) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
} else {
if (valueTypeCase_ == 6) {
valueTypeCase_ = 0;
valueType_ = null;
}
entityValueBuilder_.clear();
}
return this;
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public com.google.datastore.v1.Entity.Builder getEntityValueBuilder() {
return getEntityValueFieldBuilder().getBuilder();
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
public com.google.datastore.v1.EntityOrBuilder getEntityValueOrBuilder() {
if ((valueTypeCase_ == 6) && (entityValueBuilder_ != null)) {
return entityValueBuilder_.getMessageOrBuilder();
} else {
if (valueTypeCase_ == 6) {
return (com.google.datastore.v1.Entity) valueType_;
}
return com.google.datastore.v1.Entity.getDefaultInstance();
}
}
/**
*
* An entity value.
* - May have no key.
* - May have a key with an incomplete key path.
* - May have a reserved/read-only key.
*
*
* optional .google.datastore.v1.Entity entity_value = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.Entity, com.google.datastore.v1.Entity.Builder, com.google.datastore.v1.EntityOrBuilder>
getEntityValueFieldBuilder() {
if (entityValueBuilder_ == null) {
if (!(valueTypeCase_ == 6)) {
valueType_ = com.google.datastore.v1.Entity.getDefaultInstance();
}
entityValueBuilder_ = 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) valueType_,
getParentForChildren(),
isClean());
valueType_ = null;
}
valueTypeCase_ = 6;
onChanged();;
return entityValueBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.ArrayValue, com.google.datastore.v1.ArrayValue.Builder, com.google.datastore.v1.ArrayValueOrBuilder> arrayValueBuilder_;
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public com.google.datastore.v1.ArrayValue getArrayValue() {
if (arrayValueBuilder_ == null) {
if (valueTypeCase_ == 9) {
return (com.google.datastore.v1.ArrayValue) valueType_;
}
return com.google.datastore.v1.ArrayValue.getDefaultInstance();
} else {
if (valueTypeCase_ == 9) {
return arrayValueBuilder_.getMessage();
}
return com.google.datastore.v1.ArrayValue.getDefaultInstance();
}
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public Builder setArrayValue(com.google.datastore.v1.ArrayValue value) {
if (arrayValueBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
valueType_ = value;
onChanged();
} else {
arrayValueBuilder_.setMessage(value);
}
valueTypeCase_ = 9;
return this;
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public Builder setArrayValue(
com.google.datastore.v1.ArrayValue.Builder builderForValue) {
if (arrayValueBuilder_ == null) {
valueType_ = builderForValue.build();
onChanged();
} else {
arrayValueBuilder_.setMessage(builderForValue.build());
}
valueTypeCase_ = 9;
return this;
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public Builder mergeArrayValue(com.google.datastore.v1.ArrayValue value) {
if (arrayValueBuilder_ == null) {
if (valueTypeCase_ == 9 &&
valueType_ != com.google.datastore.v1.ArrayValue.getDefaultInstance()) {
valueType_ = com.google.datastore.v1.ArrayValue.newBuilder((com.google.datastore.v1.ArrayValue) valueType_)
.mergeFrom(value).buildPartial();
} else {
valueType_ = value;
}
onChanged();
} else {
if (valueTypeCase_ == 9) {
arrayValueBuilder_.mergeFrom(value);
}
arrayValueBuilder_.setMessage(value);
}
valueTypeCase_ = 9;
return this;
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public Builder clearArrayValue() {
if (arrayValueBuilder_ == null) {
if (valueTypeCase_ == 9) {
valueTypeCase_ = 0;
valueType_ = null;
onChanged();
}
} else {
if (valueTypeCase_ == 9) {
valueTypeCase_ = 0;
valueType_ = null;
}
arrayValueBuilder_.clear();
}
return this;
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public com.google.datastore.v1.ArrayValue.Builder getArrayValueBuilder() {
return getArrayValueFieldBuilder().getBuilder();
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
public com.google.datastore.v1.ArrayValueOrBuilder getArrayValueOrBuilder() {
if ((valueTypeCase_ == 9) && (arrayValueBuilder_ != null)) {
return arrayValueBuilder_.getMessageOrBuilder();
} else {
if (valueTypeCase_ == 9) {
return (com.google.datastore.v1.ArrayValue) valueType_;
}
return com.google.datastore.v1.ArrayValue.getDefaultInstance();
}
}
/**
*
* An array value.
* Cannot contain another array value.
* A `Value` instance that sets field `array_value` must not set fields
* `meaning` or `exclude_from_indexes`.
*
*
* optional .google.datastore.v1.ArrayValue array_value = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.ArrayValue, com.google.datastore.v1.ArrayValue.Builder, com.google.datastore.v1.ArrayValueOrBuilder>
getArrayValueFieldBuilder() {
if (arrayValueBuilder_ == null) {
if (!(valueTypeCase_ == 9)) {
valueType_ = com.google.datastore.v1.ArrayValue.getDefaultInstance();
}
arrayValueBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.datastore.v1.ArrayValue, com.google.datastore.v1.ArrayValue.Builder, com.google.datastore.v1.ArrayValueOrBuilder>(
(com.google.datastore.v1.ArrayValue) valueType_,
getParentForChildren(),
isClean());
valueType_ = null;
}
valueTypeCase_ = 9;
onChanged();;
return arrayValueBuilder_;
}
private int meaning_ ;
/**
*
* The `meaning` field should only be populated for backwards compatibility.
*
*
* optional int32 meaning = 14;
*/
public int getMeaning() {
return meaning_;
}
/**
*
* The `meaning` field should only be populated for backwards compatibility.
*
*
* optional int32 meaning = 14;
*/
public Builder setMeaning(int value) {
meaning_ = value;
onChanged();
return this;
}
/**
*
* The `meaning` field should only be populated for backwards compatibility.
*
*
* optional int32 meaning = 14;
*/
public Builder clearMeaning() {
meaning_ = 0;
onChanged();
return this;
}
private boolean excludeFromIndexes_ ;
/**
*
* If the value should be excluded from all indexes including those defined
* explicitly.
*
*
* optional bool exclude_from_indexes = 19;
*/
public boolean getExcludeFromIndexes() {
return excludeFromIndexes_;
}
/**
*
* If the value should be excluded from all indexes including those defined
* explicitly.
*
*
* optional bool exclude_from_indexes = 19;
*/
public Builder setExcludeFromIndexes(boolean value) {
excludeFromIndexes_ = value;
onChanged();
return this;
}
/**
*
* If the value should be excluded from all indexes including those defined
* explicitly.
*
*
* optional bool exclude_from_indexes = 19;
*/
public Builder clearExcludeFromIndexes() {
excludeFromIndexes_ = false;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:google.datastore.v1.Value)
}
// @@protoc_insertion_point(class_scope:google.datastore.v1.Value)
private static final com.google.datastore.v1.Value DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.datastore.v1.Value();
}
public static com.google.datastore.v1.Value getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public Value parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Value(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.datastore.v1.Value getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy