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
Nested ClassesModifier and TypeClassDescriptionstatic classBaseEntity.Builder<K extends IncompleteKey,B extends BaseEntity.Builder<K, B>> -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the entity contains a property with the givenname.booleanReturns the property value as a blob.booleangetBoolean(String name) Returns the property value as a boolean.doubleReturns 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.longReturns the property value as long.getNames()Returns the properties name.Returns the properties.Returns the property value as a string.com.google.cloud.TimestampgetTimestamp(String name) Returns the property value as a Timestamp.<V extends Value<?>>
VReturns theValuefor the given propertyname.inthashCode()booleanhasKey()Returns true if entity has a non-null key.booleanReturns 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
Returnstrueif the entity contains a property with the givenname. -
getValue
Returns theValuefor 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.
-