Package com.google.cloud.datastore
Class BaseEntity<K extends IncompleteKey>
java.lang.Object
com.google.cloud.datastore.BaseEntity<K>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FullEntity
,ProjectionEntity
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
BaseEntity.Builder<K extends IncompleteKey,
B extends BaseEntity.Builder<K, B>> -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the entity contains a property with the givenname
.boolean
Returns the property value as a blob.boolean
getBoolean
(String name) Returns the property value as a boolean.double
Returns the property value as a double.<K extends IncompleteKey>
FullEntity<K>Returns the property value as an entity.getKey()
Returns the associated key or null if it does not have one.Returns the property value as a Key.Returns the property value as a LatLng.Returns the property value as a list of values.long
Returns the property value as long.getNames()
Returns the properties name.Returns the properties.Returns the property value as a string.com.google.cloud.Timestamp
getTimestamp
(String name) Returns the property value as a Timestamp.<V extends Value<?>>
VReturns theValue
for the given propertyname
.int
hashCode()
boolean
hasKey()
Returns true if entity has a non-null key.boolean
Returns true if property is an instance of NullValue.toString()
-
Method Details
-
toString
-
hashCode
public int hashCode() -
equals
-
hasKey
public boolean hasKey()Returns true if entity has a non-null key. -
getKey
Returns the associated key or null if it does not have one. -
contains
Returnstrue
if the entity contains a property with the givenname
. -
getValue
Returns theValue
for the given propertyname
.- Throws:
DatastoreException
- if no such property
-
isNull
Returns true if property is an instance of NullValue.- Throws:
DatastoreException
- if no such property
-
getString
Returns the property value as a string.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a string
-
getLong
Returns the property value as long.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a long
-
getDouble
Returns the property value as a double.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a double
-
getBoolean
Returns the property value as a boolean.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a boolean
-
getTimestamp
Returns the property value as a Timestamp.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a Timestamp
-
getLatLng
Returns the property value as a LatLng.- Throws:
DatastoreException
- if no such property.ClassCastException
- if value is not a LatLng.
-
getKey
Returns the property value as a Key.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a Key
-
getEntity
Returns the property value as an entity.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not an entity
-
getList
Returns the property value as a list of values.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a list of values
-
getBlob
Returns the property value as a blob.- Throws:
DatastoreException
- if no such propertyClassCastException
- if value is not a blob
-
getNames
Returns the properties name. -
getProperties
Returns the properties.
-