Class Entities (2.0.0)

public final class Entities

Utility functions and constants for entities.

Inheritance

java.lang.Object > Entities

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

Field Value
TypeDescription
long

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 call on key KeyFactory.createKey(R, ENTITY_GROUP_METADATA_KIND, ENTITY_GROUP_METADATA_ID).

The resulting entity has a 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
TypeDescription
String

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
TypeDescription
String

NAMESPACE_METADATA_EMPTY_ID

public static final long NAMESPACE_METADATA_EMPTY_ID

The numeric ID for namespace keys representing the empty namespace.

Field Value
TypeDescription
long

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
TypeDescription
String

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
TypeDescription
String

Static Methods

createEntityGroupKey(Key key)

public static Key createEntityGroupKey(Key key)

Create an entity_group key for the entity group containing key.

Parameter
NameDescription
keyKey

Key of any entity in the entity group.

Returns
TypeDescription
Key

entity_group key.

createKindKey(String kind)

public static Key createKindKey(String kind)

Create a kind key for kind.

Parameter
NameDescription
kindString

Kind to create key for.

Returns
TypeDescription
Key

kind key.

createNamespaceKey(String namespace)

public static Key createNamespaceKey(String namespace)

Create a namespace key for namespace.

Parameter
NameDescription
namespaceString

Namespace to create key for.

Returns
TypeDescription
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
NameDescription
kindString

Kind to create key for.

propertyString

Property to create key for.

Returns
TypeDescription
Key

property key.

getNamespaceFromNamespaceKey(Key namespaceKey)

public static @Nullable String getNamespaceFromNamespaceKey(Key namespaceKey)

Extract the namespace name from a namespace key.

Parameter
NameDescription
namespaceKeyKey

Key to extract namespace from.

Returns
TypeDescription
@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

The namespace name.

getVersionProperty(Entity entity)

public static long getVersionProperty(Entity entity)

Get the value of the version property from entity.

Parameter
NameDescription
entityEntity

Entity to fetch version from (must have a numeric version property).

Returns
TypeDescription
long

version property value.

Constructors

Entities()

public Entities()