Class DatastoreOptions (2.32.3)

publicclass DatastoreOptions

An immutable object containing settings for the datastore.

Example for connecting to a datastore:

DatastoreOptions options = new DatastoreOptions.Builder() .projectId("my-project-id") .credential(DatastoreHelper.getComputeEngineCredential()) .build(); DatastoreFactory.get().create(options);

The options should be passed to DatastoreFactory#create.

Inheritance

java.lang.Object > DatastoreOptions

Static Fields

SCOPES

publicstaticfinalList<String>SCOPES
Field Value
Type Description
List<String>

Methods

getCredential()

publicCredentialgetCredential()
Returns
Type Description
com.google.api.client.auth.oauth2.Credential

getHost()

publicStringgetHost()
Returns
Type Description
String

getInitializer()

publicHttpRequestInitializergetInitializer()
Returns
Type Description
com.google.api.client.http.HttpRequestInitializer

getLocalHost()

publicStringgetLocalHost()
Returns
Type Description
String

getProjectEndpoint()

publicStringgetProjectEndpoint()
Returns
Type Description
String

getProjectId()

publicStringgetProjectId()
Returns
Type Description
String

getTransport()

publicHttpTransportgetTransport()
Returns
Type Description
com.google.api.client.http.HttpTransport

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.