public final class Entities
Utility functions and constants for 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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
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 |
Key Key of any entity in the entity group. |
Returns | |
---|---|
Type | Description |
Key |
entity_group key. |
createKindKey(String kind)
public static Key createKindKey(String kind)
Create a kind key for kind
.
Parameter | |
---|---|
Name | Description |
kind |
String Kind to create key for. |
Returns | |
---|---|
Type | Description |
Key |
kind key. |
createNamespaceKey(String namespace)
public static Key createNamespaceKey(String namespace)
Create a namespace key for namespace
.
Parameter | |
---|---|
Name | Description |
namespace |
String Namespace to create key for. |
Returns | |
---|---|
Type | Description |
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 |
String Kind to create key for. |
property |
String Property to create key for. |
Returns | |
---|---|
Type | Description |
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 |
Key Key to extract namespace from. |
Returns | |
---|---|
Type | Description |
@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 | |
---|---|
Name | Description |
entity |
Entity Entity to fetch version from (must have a numeric version property). |
Returns | |
---|---|
Type | Description |
long |
version property value. |
Constructors
Entities()
public Entities()