Class DatastoreOptions.Builder (2.24.3)

publicstaticclass DatastoreOptions.Builder

Builder for DatastoreOptions.

Inheritance

java.lang.Object > DatastoreOptions.Builder

Constructors

Builder()

publicBuilder()

Builder(DatastoreOptions options)

publicBuilder(DatastoreOptionsoptions)
Parameter
Name Description
options DatastoreOptions

Methods

build()

publicDatastoreOptionsbuild()
Returns
Type Description
DatastoreOptions

credential(Credential credential)

publicDatastoreOptions.Buildercredential(Credentialcredential)

Sets the Google APIs Credential used to access Cloud Datastore.

Parameter
Name Description
credential com.google.api.client.auth.oauth2.Credential
Returns
Type Description
DatastoreOptions.Builder

host(String host)

publicDatastoreOptions.Builderhost(Stringhost)

Sets the host used to access Cloud Datastore. To connect to the Cloud Datastore Emulator, use #localHost instead.

Parameter
Name Description
host String
Returns
Type Description
DatastoreOptions.Builder

initializer(HttpRequestInitializer initializer)

publicDatastoreOptions.Builderinitializer(HttpRequestInitializerinitializer)

Sets the (optional) initializer to run on HTTP requests to Cloud Datastore.

Parameter
Name Description
initializer com.google.api.client.http.HttpRequestInitializer
Returns
Type Description
DatastoreOptions.Builder

localHost(String localHost)

publicDatastoreOptions.BuilderlocalHost(StringlocalHost)

Configures the client to access Cloud Datastore on a local host (typically a Cloud Datastore Emulator instance). Call this method also configures the client not to attach credentials to requests.

Parameter
Name Description
localHost String
Returns
Type Description
DatastoreOptions.Builder

projectEndpoint(String projectEndpoint) (deprecated)

publicDatastoreOptions.BuilderprojectEndpoint(StringprojectEndpoint)

Deprecated. Use #projectId and/or #host/#localHost instead.

Sets the project endpoint used to access Cloud Datastore. Prefer using #projectId and/or #host/#localHost when possible.

Parameter
Name Description
projectEndpoint String
Returns
Type Description
DatastoreOptions.Builder

projectId(String projectId)

publicDatastoreOptions.BuilderprojectId(StringprojectId)

Sets the project ID used to access Cloud Datastore.

Parameter
Name Description
projectId String
Returns
Type Description
DatastoreOptions.Builder

transport(HttpTransport transport)

publicDatastoreOptions.Buildertransport(HttpTransporttransport)

Sets the transport used to access Cloud Datastore.

Parameter
Name Description
transport com.google.api.client.http.HttpTransport
Returns
Type Description
DatastoreOptions.Builder

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.