Package com.google.cloud.datastore
Class KeyFactory
- java.lang.Object
-
- com.google.cloud.datastore.BaseKey.Builder<KeyFactory>
-
- com.google.cloud.datastore.KeyFactory
-
public final class KeyFactory extends BaseKey.Builder<KeyFactory>
A helper for creating keys for a specificDatastore
, using its associated projectId and namespace.
-
-
Constructor Summary
Constructors Constructor Description KeyFactory(String projectId)
KeyFactory(String projectId, String namespace)
KeyFactory(String projectId, String namespace, String databaseId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IncompleteKey
build()
IncompleteKey
newKey()
Key
newKey(long id)
Key
newKey(String name)
KeyFactory
reset()
Resets the KeyFactory to its initial state.-
Methods inherited from class com.google.cloud.datastore.BaseKey.Builder
addAncestor, addAncestors, addAncestors, setDatabaseId, setKind, setNamespace, setProjectId
-
-
-
-
Method Detail
-
newKey
public IncompleteKey newKey()
-
newKey
public Key newKey(long id)
-
reset
public KeyFactory reset()
Resets the KeyFactory to its initial state.- Returns:
this
for chaining
-
build
protected IncompleteKey build()
- Specified by:
build
in classBaseKey.Builder<KeyFactory>
-
-