Class BaseEntity<K> (2.18.5)

public abstract class BaseEntity<K> implements Serializable

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

NameDescription
K

Methods

<K>getEntity(String name)

public FullEntity<K> <K>getEntity(String name)

Returns the property value as an entity.

Parameter
NameDescription
nameString
Returns
TypeDescription
FullEntity<K>

<T>getList(String name)

public List<T> <T>getList(String name)

Returns the property value as a list of values.

Parameter
NameDescription
nameString
Returns
TypeDescription
List<T>

<V>getValue(String name)

public V <V>getValue(String name)

Returns the Value for the given property name.

Parameter
NameDescription
nameString
Returns
TypeDescription
V

contains(String name)

public boolean contains(String name)

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

Parameter
NameDescription
nameString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBlob(String name)

public Blob getBlob(String name)

Returns the property value as a blob.

Parameter
NameDescription
nameString
Returns
TypeDescription
Blob

getBoolean(String name)

public boolean getBoolean(String name)

Returns the property value as a boolean.

Parameter
NameDescription
nameString
Returns
TypeDescription
boolean

getDouble(String name)

public double getDouble(String name)

Returns the property value as a double.

Parameter
NameDescription
nameString
Returns
TypeDescription
double

getKey()

public K getKey()

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

Returns
TypeDescription
K

getKey(String name)

public Key getKey(String name)

Returns the property value as a Key.

Parameter
NameDescription
nameString
Returns
TypeDescription
Key

getLatLng(String name)

public LatLng getLatLng(String name)

Returns the property value as a LatLng.

Parameter
NameDescription
nameString
Returns
TypeDescription
LatLng

getLong(String name)

public long getLong(String name)

Returns the property value as long.

Parameter
NameDescription
nameString
Returns
TypeDescription
long

getNames()

public Set<String> getNames()

Returns the properties name.

Returns
TypeDescription
Set<String>

getProperties()

public Map<String,Value<?>> getProperties()

Returns the properties.

Returns
TypeDescription
Map<String,Value<?>>

getString(String name)

public String getString(String name)

Returns the property value as a string.

Parameter
NameDescription
nameString
Returns
TypeDescription
String

getTimestamp(String name)

public Timestamp getTimestamp(String name)

Returns the property value as a Timestamp.

Parameter
NameDescription
nameString
Returns
TypeDescription
com.google.cloud.Timestamp

hasKey()

public boolean hasKey()

Returns true if entity has a non-null key.

Returns
TypeDescription
boolean

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

isNull(String name)

public boolean isNull(String name)

Returns true if property is an instance of NullValue.

Parameter
NameDescription
nameString
Returns
TypeDescription
boolean

toString()

public String toString()
Returns
TypeDescription
String
Overrides