# Class Entities (5.0.3)

    public final class Entities

Utility functions and constants for entities.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> Entities

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Fields

### ENTITY_GROUP_METADATA_ID

    public static final long ENTITY_GROUP_METADATA_ID

ID for **entity_group** entities.
See Also: [#ENTITY_GROUP_METADATA_KIND](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entities#com_google_appengine_api_datastore_Entities_ENTITY_GROUP_METADATA_KIND)

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### ENTITY_GROUP_METADATA_KIND

    public static final String ENTITY_GROUP_METADATA_KIND

A metadata kind that can be used to get information about entity groups. The metadata for the
entity group with root entity key R is fetched using a [DatastoreService#get](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.DatastoreService#com_google_appengine_api_datastore_DatastoreService_get_) call on key
`KeyFactory.createKey(R, ENTITY_GROUP_METADATA_KIND, ENTITY_GROUP_METADATA_ID)`.

The resulting entity has a [Entity#VERSION_RESERVED_PROPERTY](https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity#com_google_appengine_api_datastore_Entity_VERSION_RESERVED_PROPERTY) numeric property whose
value is guaranteed to increase on every change to the entity group. This value may also
occasionally increase without any user-visible change to the entity group.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### KIND_METADATA_KIND

    public static final String KIND_METADATA_KIND

A metadata kind that can be used to query for kinds that exist in the datastore.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### NAMESPACE_METADATA_EMPTY_ID

    public static final long NAMESPACE_METADATA_EMPTY_ID

The numeric ID for **namespace** keys representing the empty namespace.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### NAMESPACE_METADATA_KIND

    public static final String NAMESPACE_METADATA_KIND

A metadata kind that can be used to query for namespaces that exist in the datastore.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### PROPERTY_METADATA_KIND

    public static final String PROPERTY_METADATA_KIND

A metadata kind that can be used to query for properties that exist in the datastore.

| **Field Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

## Static Methods

### createEntityGroupKey(Key key)

    public static Key createEntityGroupKey(Key key)

Create an **entity_group** key for the entity group containing `key`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` Key of any entity in the entity group. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` | **entity_group** key. |

### createKindKey(String kind)

    public static Key createKindKey(String kind)

Create a **kind** key for `kind`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `kind` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Kind to create key for. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` | **kind** key. |

### createNamespaceKey(String namespace)

    public static Key createNamespaceKey(String namespace)

Create a **namespace** key for `namespace`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `namespace` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Namespace to create key for. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` | **namespace** key. |

### createPropertyKey(String kind, String property)

    public static Key createPropertyKey(String kind, String property)

Create a **property** key for `property` of `kind`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kind` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Kind to create key for. |
| `property` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Property to create key for. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` | **property** key. |

### getNamespaceFromNamespaceKey(Key namespaceKey)

    public static @Nullable String getNamespaceFromNamespaceKey(Key namespaceKey)

Extract the namespace name from a **namespace** key.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `namespaceKey` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Key` Key to extract namespace from. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/@org/jspecify/annotations/Nullable String.html` | The namespace name. |

### getVersionProperty(Entity entity)

    public static long getVersionProperty(Entity entity)

Get the value of the **version** property from `entity`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `entity` | `https://docs.cloud.google.com/appengine/docs/standard/java-gen2/reference/services/bundled/latest/com.google.appengine.api.datastore.Entity` Entity to fetch **version** from (must have a numeric **version** property). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | **version** property value. |

## Constructors

### Entities()

    public Entities()