Class StoreConfig.Builder

java.lang.Object
me.ahoo.cosid.store.StoreConfig.Builder
Enclosing class:
StoreConfig

public static final class StoreConfig.Builder extends Object
Builds a StoreConfig; build() checks the fields.
  • Method Details

    • timeout

      public StoreConfig.Builder timeout(Duration timeout)
      Sets the operation timeout, enforced by the backend's own mechanism.
      Parameters:
      timeout - the timeout, positive; default StoreConfig.DEFAULT_TIMEOUT
      Returns:
      this builder
    • option

      public StoreConfig.Builder option(String key, Object value)
      Sets a backend option.
      Parameters:
      key - the option key
      value - the value
      Returns:
      this builder
    • options

      public StoreConfig.Builder options(Map<String,?> options)
      Sets backend options, keeping those set before under other keys.
      Parameters:
      options - the options
      Returns:
      this builder
    • client

      public StoreConfig.Builder client(Object client)
      Sets an existing connection object; the provider does not close it.
      Parameters:
      client - the client; by default the provider creates its own from the options and closes it
      Returns:
      this builder
    • build

      public StoreConfig build()
      Builds the config.
      Returns:
      the config
      Throws:
      IllegalArgumentException - if the timeout is not positive