[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class BaseEntity<K> (2.31.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.31.2 (latest)](/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.BaseEntity)\n- [2.31.1](/java/docs/reference/google-cloud-datastore/2.31.1/com.google.cloud.datastore.BaseEntity)\n- [2.30.0](/java/docs/reference/google-cloud-datastore/2.30.0/com.google.cloud.datastore.BaseEntity)\n- [2.29.1](/java/docs/reference/google-cloud-datastore/2.29.1/com.google.cloud.datastore.BaseEntity)\n- [2.28.2](/java/docs/reference/google-cloud-datastore/2.28.2/com.google.cloud.datastore.BaseEntity)\n- [2.27.1](/java/docs/reference/google-cloud-datastore/2.27.1/com.google.cloud.datastore.BaseEntity)\n- [2.26.4](/java/docs/reference/google-cloud-datastore/2.26.4/com.google.cloud.datastore.BaseEntity)\n- [2.25.2](/java/docs/reference/google-cloud-datastore/2.25.2/com.google.cloud.datastore.BaseEntity)\n- [2.24.3](/java/docs/reference/google-cloud-datastore/2.24.3/com.google.cloud.datastore.BaseEntity)\n- [2.23.0](/java/docs/reference/google-cloud-datastore/2.23.0/com.google.cloud.datastore.BaseEntity)\n- [2.22.0](/java/docs/reference/google-cloud-datastore/2.22.0/com.google.cloud.datastore.BaseEntity)\n- [2.21.3](/java/docs/reference/google-cloud-datastore/2.21.3/com.google.cloud.datastore.BaseEntity)\n- [2.20.2](/java/docs/reference/google-cloud-datastore/2.20.2/com.google.cloud.datastore.BaseEntity)\n- [2.19.2](/java/docs/reference/google-cloud-datastore/2.19.2/com.google.cloud.datastore.BaseEntity)\n- [2.18.5](/java/docs/reference/google-cloud-datastore/2.18.5/com.google.cloud.datastore.BaseEntity)\n- [2.17.6](/java/docs/reference/google-cloud-datastore/2.17.6/com.google.cloud.datastore.BaseEntity) \n\n public abstract class BaseEntity\u003cK\u003e implements Serializable\n\nA base class for entities (key and properties). An entity is a Google Cloud Datastore persistent\ndata object. An entity holds one or more properties, represented by a name (as [String](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html))\nand a value (as [com.google.cloud.datastore.Value](/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.Value)), and may be associated with a key. For\na list of possible values see [ValueType](/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.ValueType).\nSee Also: [Google Cloud Datastore Entities, Properties, and Keys](https://cloud.google.com/datastore/docs/concepts/entities) \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e BaseEntity\\\u003cK\\\u003e \n\nImplements\n----------\n\n[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nMethods\n-------\n\n### \\\u003cK\\\u003egetEntity(String name)\n\n public FullEntity\u003cK\u003e \u003cK\u003egetEntity(String name)\n\nReturns the property value as an entity.\n\n### \\\u003cT\\\u003egetList(String name)\n\n public List\u003cT\u003e \u003cT\u003egetList(String name)\n\nReturns the property value as a list of values.\n\n### \\\u003cV\\\u003egetValue(String name)\n\n public V \u003cV\u003egetValue(String name)\n\nReturns the [Value](/java/docs/reference/google-cloud-datastore/latest/com.google.cloud.datastore.Value) for the given property `name`.\n\n### contains(String name)\n\n public boolean contains(String name)\n\nReturns `true` if the entity contains a property with the given `name`.\n\n### equals(Object obj)\n\n public boolean equals(Object obj)\n\n**Overrides** \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)\n\n### getBlob(String name)\n\n public Blob getBlob(String name)\n\nReturns the property value as a blob.\n\n### getBoolean(String name)\n\n public boolean getBoolean(String name)\n\nReturns the property value as a boolean.\n\n### getDouble(String name)\n\n public double getDouble(String name)\n\nReturns the property value as a double.\n\n### getKey()\n\n public K getKey()\n\nReturns the associated key or null if it does not have one.\n\n### getKey(String name)\n\n public Key getKey(String name)\n\nReturns the property value as a Key.\n\n### getLatLng(String name)\n\n public LatLng getLatLng(String name)\n\nReturns the property value as a LatLng.\n\n### getLong(String name)\n\n public long getLong(String name)\n\nReturns the property value as long.\n\n### getNames()\n\n public Set\u003cString\u003e getNames()\n\nReturns the properties name.\n\n### getProperties()\n\n public Map\u003cString,Value\u003c?\u003e\u003e getProperties()\n\nReturns the properties.\n\n### getString(String name)\n\n public String getString(String name)\n\nReturns the property value as a string.\n\n### getTimestamp(String name)\n\n public Timestamp getTimestamp(String name)\n\nReturns the property value as a Timestamp.\n\n### hasKey()\n\n public boolean hasKey()\n\nReturns true if entity has a non-null key.\n\n### hashCode()\n\n public int hashCode()\n\n**Overrides** \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)\n\n### isNull(String name)\n\n public boolean isNull(String name)\n\nReturns true if property is an instance of NullValue.\n\n### toString()\n\n public String toString()\n\n**Overrides** \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)"]]