Class Entity (2.17.6)

publicfinalclass EntityextendsGeneratedMessageV3implementsEntityOrBuilder

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.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

Static Fields

KEY_FIELD_NUMBER

publicstaticfinalintKEY_FIELD_NUMBER
Field Value
Type Description
int

PROPERTIES_FIELD_NUMBER

publicstaticfinalintPROPERTIES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

publicstaticEntitygetDefaultInstance()
Returns
Type Description
Entity

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

newBuilder()

publicstaticEntity.BuildernewBuilder()
Returns
Type Description
Entity.Builder

newBuilder(Entity prototype)

publicstaticEntity.BuildernewBuilder(Entityprototype)
Parameter
Name Description
prototype Entity
Returns
Type Description
Entity.Builder

parseDelimitedFrom(InputStream input)

publicstaticEntityparseDelimitedFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseDelimitedFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseFrom(byte[] data)

publicstaticEntityparseFrom(byte[]data)
Parameter
Name Description
data byte[]
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseFrom(byte[]data,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

publicstaticEntityparseFrom(ByteStringdata)
Parameter
Name Description
data ByteString
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseFrom(ByteStringdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

publicstaticEntityparseFrom(CodedInputStreaminput)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseFrom(InputStream input)

publicstaticEntityparseFrom(InputStreaminput)
Parameter
Name Description
input InputStream
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseFrom(InputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

publicstaticEntityparseFrom(ByteBufferdata)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

publicstaticEntityparseFrom(ByteBufferdata,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Entity
Exceptions
Type Description
InvalidProtocolBufferException

parser()

publicstaticParser<Entity>parser()
Returns
Type Description
Parser<Entity>

Methods

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

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

publicEntitygetDefaultInstanceForType()
Returns
Type Description
Entity

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.

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

getParserForType()

publicParser<Entity>getParserForType()
Returns
Type Description
Parser<Entity>
Overrides

getProperties()

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

getSerializedSize()

publicintgetSerializedSize()
Returns
Type Description
int
Overrides

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.

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapField(int number)

protectedMapFieldinternalGetMapField(intnumber)
Parameter
Name Description
number int
Returns
Type Description
MapField
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

publicEntity.BuildernewBuilderForType()
Returns
Type Description
Entity.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protectedEntity.BuildernewBuilderForType(GeneratedMessageV3.BuilderParentparent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Entity.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protectedObjectnewInstance(GeneratedMessageV3.UnusedPrivateParameterunused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

publicEntity.BuildertoBuilder()
Returns
Type Description
Entity.Builder

writeTo(CodedOutputStream output)

publicvoidwriteTo(CodedOutputStreamoutput)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException

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.