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 IncompleteKeybuild()IncompleteKeynewKey()KeynewKey(long id)KeynewKey(String name)KeyFactoryreset()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:
thisfor chaining
-
build
protected IncompleteKey build()
- Specified by:
buildin classBaseKey.Builder<KeyFactory>
-
-