public abstract class BaseEntity<K extends IncompleteKey> extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BaseEntity.Builder<K extends IncompleteKey,B extends BaseEntity.Builder<K,B>> |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String name)
Returns
true if the entity contains a property with the given name . |
boolean |
equals(Object obj) |
Blob |
getBlob(String name)
Returns the property value as a blob.
|
boolean |
getBoolean(String name)
Returns the property value as a boolean.
|
double |
getDouble(String name)
Returns the property value as a double.
|
<K extends IncompleteKey> |
getEntity(String name)
Returns the property value as an entity.
|
K |
getKey()
Returns the associated key or null if it does not have one.
|
Key |
getKey(String name)
Returns the property value as a Key.
|
LatLng |
getLatLng(String name)
Returns the property value as a LatLng.
|
<T extends Value<?>> |
getList(String name)
Returns the property value as a list of values.
|
long |
getLong(String name)
Returns the property value as long.
|
Set<String> |
getNames()
Returns the properties name.
|
Map<String,Value<?>> |
getProperties()
Returns the properties.
|
String |
getString(String name)
Returns the property value as a string.
|
com.google.cloud.Timestamp |
getTimestamp(String name)
Returns the property value as a Timestamp.
|
<V extends Value<?>> |
getValue(String name)
Returns the
Value for the given property name . |
int |
hashCode() |
boolean |
hasKey()
Returns true if entity has a non-null key.
|
boolean |
isNull(String name)
Returns true if property is an instance of NullValue.
|
String |
toString() |
public boolean hasKey()
public K getKey()
public boolean contains(String name)
true
if the entity contains a property with the given name
.public <V extends Value<?>> V getValue(String name)
Value
for the given property name
.DatastoreException
- if no such propertypublic boolean isNull(String name)
DatastoreException
- if no such propertypublic String getString(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a stringpublic long getLong(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a longpublic double getDouble(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a doublepublic boolean getBoolean(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a booleanpublic com.google.cloud.Timestamp getTimestamp(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a Timestamppublic LatLng getLatLng(String name)
DatastoreException
- if no such property.ClassCastException
- if value is not a LatLng.public Key getKey(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a Keypublic <K extends IncompleteKey> FullEntity<K> getEntity(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not an entitypublic <T extends Value<?>> List<T> getList(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a list of valuespublic Blob getBlob(String name)
DatastoreException
- if no such propertyClassCastException
- if value is not a blobCopyright © 2019 Google LLC. All rights reserved.