Class KeyFactory (2.23.0)

publicfinalclass KeyFactoryextendsBaseKey.Builder<KeyFactory>

A helper for creating keys for a specific Datastore, using its associated projectId and namespace.

Inheritance

java.lang.Object > BaseKey.Builder > KeyFactory

Constructors

KeyFactory(String projectId)

publicKeyFactory(StringprojectId)
Parameter
Name Description
projectId String

KeyFactory(String projectId, String namespace)

publicKeyFactory(StringprojectId,Stringnamespace)
Parameters
Name Description
projectId String
namespace String

KeyFactory(String projectId, String namespace, String databaseId)

publicKeyFactory(StringprojectId,Stringnamespace,StringdatabaseId)
Parameters
Name Description
projectId String
namespace String
databaseId String

Methods

build()

protectedIncompleteKeybuild()
Returns
Type Description
IncompleteKey
Overrides

newKey()

publicIncompleteKeynewKey()
Returns
Type Description
IncompleteKey

newKey(String name)

publicKeynewKey(Stringname)
Parameter
Name Description
name String
Returns
Type Description
Key

newKey(long id)

publicKeynewKey(longid)
Parameter
Name Description
id long
Returns
Type Description
Key

reset()

publicKeyFactoryreset()

Resets the KeyFactory to its initial state.

Returns
Type Description
KeyFactory

this for chaining

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.