Class AbstractOptions<T extends AbstractOption<T,U,Object>,U extends AbstractOptionValue<U,T,Object>>

java.lang.Object
com.linecorp.armeria.common.util.AbstractOptions<T,U>
Type Parameters:
T - the type of the option.
U - the type of the option value holder.
All Implemented Interfaces:
Iterable<U>
Direct Known Subclasses:
ClientFactoryOptions, ClientOptions

public abstract class AbstractOptions<T extends AbstractOption<T,U,Object>,U extends AbstractOptionValue<U,T,Object>> extends Object implements Iterable<U>
A set of configuration options and their respective values.
See Also:
  • Constructor Details

    • AbstractOptions

      protected AbstractOptions(Iterable<? extends AbstractOptionValue<?,?,?>> values)
      Creates a new instance.
      Parameters:
      values - the option values
    • AbstractOptions

      protected AbstractOptions(AbstractOptions<T,U> baseOptions, Iterable<? extends AbstractOptionValue<?,?,?>> additionalValues)
      Creates a new instance.
      Parameters:
      baseOptions - the base options to merge
      additionalValues - the option values
  • Method Details

    • get

      public final <V> V get(AbstractOption<?,?,V> option)
      Returns the value of the specified option.
      Type Parameters:
      V - the type of the value
    • iterator

      public final Iterator<U> iterator()
      Returns an immutable Iterator of user-specified options.
      Specified by:
      iterator in interface Iterable<T extends AbstractOption<T,U,Object>>
    • asMap

      public final Map<T,U> asMap()
      Returns an immutable Map of user-specified options.
    • toString

      public final String toString()
      Overrides:
      toString in class Object