Class Entity.Builder (2.31.4)

publicstaticfinalclass Entity.BuilderextendsGeneratedMessageV3.Builder<Entity.Builder>implementsEntityOrBuilder

A Datastore data object.

Must not exceed 1 MiB - 4 bytes.

Protobuf type google.datastore.v1.Entity

Implements

EntityOrBuilder

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicEntity.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Entity.Builder
Overrides

build()

publicEntitybuild()
Returns
Type Description
Entity

buildPartial()

publicEntitybuildPartial()
Returns
Type Description
Entity

clear()

publicEntity.Builderclear()
Returns
Type Description
Entity.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

publicEntity.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Entity.Builder
Overrides

clearKey()

publicEntity.BuilderclearKey()

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Returns
Type Description
Entity.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

publicEntity.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Entity.Builder
Overrides

clearProperties()

publicEntity.BuilderclearProperties()
Returns
Type Description
Entity.Builder

clone()

publicEntity.Builderclone()
Returns
Type Description
Entity.Builder
Overrides

containsProperties(String key)

publicbooleancontainsProperties(Stringkey)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

publicEntitygetDefaultInstanceForType()
Returns
Type Description
Entity

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getKey()

publicKeygetKey()

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Returns
Type Description
Key

The key.

getKeyBuilder()

publicKey.BuildergetKeyBuilder()

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Returns
Type Description
Key.Builder

getKeyOrBuilder()

publicKeyOrBuildergetKeyOrBuilder()

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Returns
Type Description
KeyOrBuilder

getMutableProperties() (deprecated)

publicMap<String,Value>getMutableProperties()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,Value>

getProperties() (deprecated)

publicMap<String,Value>getProperties()

Use #getPropertiesMap() instead.

Returns
Type Description
Map<String,Value>

getPropertiesCount()

publicintgetPropertiesCount()

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Returns
Type Description
int

getPropertiesMap()

publicMap<String,Value>getPropertiesMap()

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Returns
Type Description
Map<String,Value>

getPropertiesOrDefault(String key, Value defaultValue)

publicValuegetPropertiesOrDefault(Stringkey,ValuedefaultValue)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameters
Name Description
key String
defaultValue Value
Returns
Type Description
Value

getPropertiesOrThrow(String key)

publicValuegetPropertiesOrThrow(Stringkey)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameter
Name Description
key String
Returns
Type Description
Value

hasKey()

publicbooleanhasKey()

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Returns
Type Description
boolean

Whether the key field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protectedMapFieldReflectionAccessorinternalGetMapFieldReflection(intnumber)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protectedMapFieldReflectionAccessorinternalGetMutableMapFieldReflection(intnumber)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Entity other)

publicEntity.BuildermergeFrom(Entityother)
Parameter
Name Description
other Entity
Returns
Type Description
Entity.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicEntity.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicEntity.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
Entity.Builder
Overrides

mergeKey(Key value)

publicEntity.BuildermergeKey(Keyvalue)

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Parameter
Name Description
value Key
Returns
Type Description
Entity.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalEntity.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Entity.Builder
Overrides

putAllProperties(Map<String,Value> values)

publicEntity.BuilderputAllProperties(Map<String,Value>values)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameter
Name Description
values Map<String,Value>
Returns
Type Description
Entity.Builder

putProperties(String key, Value value)

publicEntity.BuilderputProperties(Stringkey,Valuevalue)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameters
Name Description
key String
value Value
Returns
Type Description
Entity.Builder

putPropertiesBuilderIfAbsent(String key)

publicValue.BuilderputPropertiesBuilderIfAbsent(Stringkey)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameter
Name Description
key String
Returns
Type Description
Value.Builder

removeProperties(String key)

publicEntity.BuilderremoveProperties(Stringkey)

The entity's properties. The map's keys are property names. A property name matching regex .* is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty.

map<string, .google.datastore.v1.Value> properties = 3;

Parameter
Name Description
key String
Returns
Type Description
Entity.Builder

setField(Descriptors.FieldDescriptor field, Object value)

publicEntity.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Entity.Builder
Overrides

setKey(Key value)

publicEntity.BuildersetKey(Keyvalue)

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Parameter
Name Description
value Key
Returns
Type Description
Entity.Builder

setKey(Key.Builder builderForValue)

publicEntity.BuildersetKey(Key.BuilderbuilderForValue)

The entity's key.

An entity must have a key, unless otherwise documented (for example, an entity in Value.entity_value may have no key). An entity's kind is its key path's last element's kind, or null if it has no key.

.google.datastore.v1.Key key = 1;

Parameter
Name Description
builderForValue Key.Builder
Returns
Type Description
Entity.Builder

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

publicEntity.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Entity.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalEntity.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Entity.Builder
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.