org.wildfly.swarm.spi.api.config

## Class Builder<T>

- java.lang.Object
- - org.wildfly.swarm.spi.api.config.Builder<T>

- All Implemented Interfaces:
    Resolver<T>

      public class Builder<T>
      extends Object
      implements Resolver<T>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Builder(ConfigView view, ConfigKey key)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<N> Resolver<N>` | `as(Class<N> clazz)` Retrieve a resolver capable of coercing to another simple type.
    `<N> Resolver<N>` | `as(Class<N> clazz, Converter<N> converter)` Retrieve a resolver capable of coering to another type.
    `ConfigKey` | `getKey()` Retrieve the key of the configuration item.
    `T` | `getValue()` Retrieve the coerced value.
    `boolean` | `hasValue()` Determine if there is any value set.
    `Resolver<T>` | `withDefault(T value)` Provide a default value to be provided in the case no value is currently bound.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Builder

          public Builder(ConfigView view,
                         ConfigKey key)

  - ### Method Detail

    - #### as

          public <N> Resolver<N> as(Class<N> clazz)

      Description copied from interface: `Resolver`
      Retrieve a resolver capable of coercing to another simple type.
      Specified by:
        `as` in interface `Resolver<T>`
      Type Parameters:
        `N` - The value type to coerce to.
      Parameters:
        `clazz` - The class to coerce to.
      Returns:
        A new resolver capable of coercing to the given type.

    - #### as

          public <N> Resolver<N> as(Class<N> clazz,
                                    Converter<N> converter)

      Description copied from interface: `Resolver`
      Retrieve a resolver capable of coering to another type.
      Specified by:
        `as` in interface `Resolver<T>`
      Type Parameters:
        `N` - The value type to coerce to.
      Parameters:
        `clazz` - The class to coerce to.
        `converter` - The converter to support the coercion.
      Returns:
        A new resolver capable of coercing to the given type.

    - #### getKey

          public ConfigKey getKey()

      Description copied from interface: `Resolver`
      Retrieve the key of the configuration item.
      Specified by:
        `getKey` in interface `Resolver<T>`
      Returns:
        The key.

    - #### getValue

          public T getValue()

      Description copied from interface: `Resolver`
      Retrieve the coerced value.
      Specified by:
        `getValue` in interface `Resolver<T>`
      Returns:
        The coerced value.

    - #### hasValue

          public boolean hasValue()

      Description copied from interface: `Resolver`
      Determine if there is any value set.
      Specified by:
        `hasValue` in interface `Resolver<T>`
      Returns:
        `true` if a value is set, otherwise `false`

    - #### withDefault

          public Resolver<T> withDefault(T value)

      Description copied from interface: `Resolver`
      Provide a default value to be provided in the case no value is currently bound.
      Specified by:
        `withDefault` in interface `Resolver<T>`
      Parameters:
        `value` - The default fall-back value.
      Returns:
        This resolver.

Copyright © 2017 JBoss by Red Hat. All rights reserved.