Class ClientOptions.Builder

java.lang.Object
io.superdurable.dex.ClientOptions.Builder
Enclosing class:
ClientOptions

public static final class ClientOptions.Builder extends Object
Builds immutable Client options.
  • Method Details

    • serverAddress

      public ClientOptions.Builder serverAddress(String value)
      Sets the Dex gRPC server target.
      Parameters:
      value - the server target; the default is localhost:8801
      Returns:
      this builder
    • objectMapper

      public ClientOptions.Builder objectMapper(com.fasterxml.jackson.databind.ObjectMapper value)
      Sets the Jackson mapper for application values.
      Parameters:
      value - a nonnull mapper
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if value is null
    • credential

      public ClientOptions.Builder credential(Credential value)
      Sets the token source for every Client FlowService call.

      The source can be called concurrently and must not block. A failure prevents Dex contact and throws DexServiceException with gRPC UNAUTHENTICATED. The default null sends no authorization metadata. See the builder example above.

      Parameters:
      value - the credential, or null to send no token
      Returns:
      this builder
    • build

      public ClientOptions build()
      Builds immutable options for a Client.
      Returns:
      the configured options
      Throws:
      IllegalArgumentException - if the mapper is null