Class FirestoreOptions.Builder

java.lang.Object
com.google.cloud.ServiceOptions.Builder<Firestore,FirestoreOptions,FirestoreOptions.Builder>
com.google.cloud.firestore.FirestoreOptions.Builder
Enclosing class:
FirestoreOptions

public static class FirestoreOptions.Builder extends com.google.cloud.ServiceOptions.Builder<Firestore,FirestoreOptions,FirestoreOptions.Builder>
  • Method Details

    • setTransportOptions

      @Nonnull public FirestoreOptions.Builder setTransportOptions(@Nonnull com.google.cloud.TransportOptions transportOptions)
      Sets the TransportOptions to use with this Firestore client.
      Overrides:
      setTransportOptions in class com.google.cloud.ServiceOptions.Builder<Firestore,FirestoreOptions,FirestoreOptions.Builder>
      Parameters:
      transportOptions - A GrpcTransportOptions object that defines the transport options for this client.
    • setChannelProvider

      @Nonnull public FirestoreOptions.Builder setChannelProvider(@Nonnull com.google.api.gax.rpc.TransportChannelProvider channelProvider)
      Sets the TransportChannelProvider to use with this Firestore client.
      Parameters:
      channelProvider - A InstantiatingGrpcChannelProvider object that defines the transport provider for this client.
    • setCredentialsProvider

      @Nonnull public FirestoreOptions.Builder setCredentialsProvider(@Nonnull com.google.api.gax.core.CredentialsProvider credentialsProvider)
      Sets the CredentialsProvider to use with this Firestore client.
      Parameters:
      credentialsProvider - A CredentialsProvider object that defines the credential provider for this client.
    • setEmulatorHost

      public FirestoreOptions.Builder setEmulatorHost(@Nonnull 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.
      Parameters:
      emulatorHost - The Firestore emulator host to use with this client.
    • setAlwaysUseImplicitOrderBy

      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.

      Parameters:
      alwaysUseImplicitOrderBy - Whether to always include implicit order by clauses.
    • setDatabaseId

      public FirestoreOptions.Builder setDatabaseId(@Nonnull String databaseId)
      Sets the database ID to use with this Firestore client.
      Parameters:
      databaseId - The Firestore database ID to use with this client.
    • setOpenTelemetryOptions

      @BetaApi @Nonnull public FirestoreOptions.Builder setOpenTelemetryOptions(@Nonnull FirestoreOpenTelemetryOptions openTelemetryOptions)
      Sets the FirestoreOpenTelemetryOptions to be used for this Firestore instance.
      Parameters:
      openTelemetryOptions - The `FirestoreOpenTelemetryOptions` to use.
    • build

      @Nonnull public FirestoreOptions build()
      Specified by:
      build in class com.google.cloud.ServiceOptions.Builder<Firestore,FirestoreOptions,FirestoreOptions.Builder>