Class FirestoreOptions.Builder (3.41.0)

public static class FirestoreOptions.Builder extends ServiceOptions.Builder<Firestore,FirestoreOptions,FirestoreOptions.Builder>

Inheritance

java.lang.Object > com.google.cloud.ServiceOptions.Builder > FirestoreOptions.Builder

Methods

build()

public FirestoreOptions build()
Returns
Type Description
FirestoreOptions
Overrides
com.google.cloud.ServiceOptions.Builder.build()

setAlwaysUseImplicitOrderBy(boolean alwaysUseImplicitOrderBy)

public FirestoreOptions.Builder setAlwaysUseImplicitOrderBy(boolean alwaysUseImplicitOrderBy)

Sets whether to always include implicit order by clauses in the query request (e.g., for inequality queries).

By default, the SDK only sends explicit order by clauses and relies on the backend to append implicit ones (unless cursors are used). Firestore Enterprise edition, however, does not automatically append these clauses because it does not require an index for every query. This option allows users to opt-in to having the SDK always append the implicit order by clauses, ensuring behavior consistent with standard edition.

Setting this option to true against Standard Edition is essentially a no-op as Standard Edition automatically apply implicit orderby from the backend.

Parameter
Name Description
alwaysUseImplicitOrderBy boolean

Whether to always include implicit order by clauses.

Returns
Type Description
FirestoreOptions.Builder

setChannelProvider(TransportChannelProvider channelProvider)

public FirestoreOptions.Builder setChannelProvider(TransportChannelProvider channelProvider)

Sets the TransportChannelProvider to use with this Firestore client.

Parameter
Name Description
channelProvider TransportChannelProvider

A InstantiatingGrpcChannelProvider object that defines the transport provider for this client.

Returns
Type Description
FirestoreOptions.Builder

setCredentialsProvider(CredentialsProvider credentialsProvider)

public FirestoreOptions.Builder setCredentialsProvider(CredentialsProvider credentialsProvider)

Sets the CredentialsProvider to use with this Firestore client.

Parameter
Name Description
credentialsProvider CredentialsProvider

A CredentialsProvider object that defines the credential provider for this client.

Returns
Type Description
FirestoreOptions.Builder

setDatabaseId(String databaseId)

public FirestoreOptions.Builder setDatabaseId(String databaseId)

Sets the database ID to use with this Firestore client.

Parameter
Name Description
databaseId String

The Firestore database ID to use with this client.

Returns
Type Description
FirestoreOptions.Builder

setEmulatorHost(String emulatorHost)

public FirestoreOptions.Builder setEmulatorHost(String emulatorHost)

Sets the emulator host to use with this Firestore client. The value passed to this method will take precedent if the FIRESTORE_EMULATOR_HOST environment variable is also set.

Parameter
Name Description
emulatorHost String

The Firestore emulator host to use with this client.

Returns
Type Description
FirestoreOptions.Builder

setOpenTelemetryOptions(FirestoreOpenTelemetryOptions openTelemetryOptions)

public FirestoreOptions.Builder setOpenTelemetryOptions(FirestoreOpenTelemetryOptions openTelemetryOptions)

Sets the FirestoreOpenTelemetryOptions to be used for this Firestore instance.

Parameter
Name Description
openTelemetryOptions FirestoreOpenTelemetryOptions

The FirestoreOpenTelemetryOptions to use.

Returns
Type Description
FirestoreOptions.Builder

setTransportOptions(TransportOptions transportOptions)

public FirestoreOptions.Builder setTransportOptions(TransportOptions transportOptions)

Sets the TransportOptions to use with this Firestore client.

Parameter
Name Description
transportOptions com.google.cloud.TransportOptions

A GrpcTransportOptions object that defines the transport options for this client.

Returns
Type Description
FirestoreOptions.Builder
Overrides
com.google.cloud.ServiceOptions.Builder.setTransportOptions(com.google.cloud.TransportOptions)