Class BaseEntity<K> (2.30.0)

publicabstractclass BaseEntity<K>implementsSerializable

A base class for entities (key and properties). An entity is a Google Cloud Datastore persistent data object. An entity holds one or more properties, represented by a name (as String) and a value (as com.google.cloud.datastore.Value), and may be associated with a key. For a list of possible values see ValueType. See Also: Google Cloud Datastore Entities, Properties, and Keys

Inheritance

Object > BaseEntity<K>

Implements

Serializable

Type Parameter

Name Description
K

Methods

<K>getEntity(String name)

publicFullEntity<K><K>getEntity(Stringname)

Returns the property value as an entity.

Parameter
Name Description
name String
Returns
Type Description
FullEntity<K>

<T>getList(String name)

publicList<T><T>getList(Stringname)

Returns the property value as a list of values.

Parameter
Name Description
name String
Returns
Type Description
List<T>

<V>getValue(String name)

publicV<V>getValue(Stringname)

Returns the Value for the given property name.

Parameter
Name Description
name String
Returns
Type Description
V

contains(String name)

publicbooleancontains(Stringname)

Returns true if the entity contains a property with the given name.

Parameter
Name Description
name String
Returns
Type Description
boolean

equals(Object obj)

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

getBlob(String name)

publicBlobgetBlob(Stringname)

Returns the property value as a blob.

Parameter
Name Description
name String
Returns
Type Description
Blob

getBoolean(String name)

publicbooleangetBoolean(Stringname)

Returns the property value as a boolean.

Parameter
Name Description
name String
Returns
Type Description
boolean

getDouble(String name)

publicdoublegetDouble(Stringname)

Returns the property value as a double.

Parameter
Name Description
name String
Returns
Type Description
double

getKey()

publicKgetKey()

Returns the associated key or null if it does not have one.

Returns
Type Description
K

getKey(String name)

publicKeygetKey(Stringname)

Returns the property value as a Key.

Parameter
Name Description
name String
Returns
Type Description
Key

getLatLng(String name)

publicLatLnggetLatLng(Stringname)

Returns the property value as a LatLng.

Parameter
Name Description
name String
Returns
Type Description
LatLng

getLong(String name)

publiclonggetLong(Stringname)

Returns the property value as long.

Parameter
Name Description
name String
Returns
Type Description
long

getNames()

publicSet<String>getNames()

Returns the properties name.

Returns
Type Description
Set<String>

getProperties()

publicMap<String,Value<?>>getProperties()

Returns the properties.

Returns
Type Description
Map<String,Value<?>>

getString(String name)

publicStringgetString(Stringname)

Returns the property value as a string.

Parameter
Name Description
name String
Returns
Type Description
String

getTimestamp(String name)

publicTimestampgetTimestamp(Stringname)

Returns the property value as a Timestamp.

Parameter
Name Description
name String
Returns
Type Description
com.google.cloud.Timestamp

hasKey()

publicbooleanhasKey()

Returns true if entity has a non-null key.

Returns
Type Description
boolean

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

isNull(String name)

publicbooleanisNull(Stringname)

Returns true if property is an instance of NullValue.

Parameter
Name Description
name String
Returns
Type Description
boolean

toString()

publicStringtoString()
Returns
Type Description
String
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.