Interface OptionSet

All Known Subinterfaces:
OptionManager
All Known Implementing Classes:
BaseOptionManager, FallbackOptionManager, FragmentOptionManager, InMemoryOptionManager, QueryOptionManager, SessionOptionManager, SystemOptionManager

public interface OptionSet
Immutable set of options accessible by name or validator.
  • Method Details

    • getOption

      OptionValue getOption(String name)
      Gets the option value for the given option name. This interface also provides convenient methods to get typed option values: getOption(TypeValidators.BooleanValidator validator), getOption(TypeValidators.DoubleValidator validator), getOption(TypeValidators.LongValidator validator), and getOption(TypeValidators.StringValidator validator).
      Parameters:
      name - option name
      Returns:
      the option value, null if the option does not exist
    • getDefault

      OptionValue getDefault(String optionName)
      Gets the default value for the specified option.
      Parameters:
      optionName - The option to retrieve the default value for.
      Returns:
      The default value for the option.
    • getOption

      boolean getOption(TypeValidators.BooleanValidator validator)
      Gets the boolean value (from the option value) for the given boolean validator.
      Parameters:
      validator - the boolean validator
      Returns:
      the boolean value
    • getOption

      double getOption(TypeValidators.DoubleValidator validator)
      Gets the double value (from the option value) for the given double validator.
      Parameters:
      validator - the double validator
      Returns:
      the double value
    • getOption

      long getOption(TypeValidators.LongValidator validator)
      Gets the long value (from the option value) for the given long validator.
      Parameters:
      validator - the long validator
      Returns:
      the long value
    • getOption

      String getOption(TypeValidators.StringValidator validator)
      Gets the string value (from the option value) for the given string validator.
      Parameters:
      validator - the string validator
      Returns:
      the string value
    • getBoolean

      boolean getBoolean(String name)
      Return the value of a Boolean option.
      Parameters:
      name - option name
      Returns:
      the Boolean value
      Throws:
      IllegalArgumentException - if the option is undefined or is not of the correct data type
    • getInt

      int getInt(String name)
      Return the value of a long option as an int
      Parameters:
      name - option name
      Returns:
      the long value
      Throws:
      IllegalArgumentException - if the option is undefined or is not of the correct data type
    • getLong

      long getLong(String name)
      Return the value of a long option.
      Parameters:
      name - option name
      Returns:
      the long value
      Throws:
      IllegalArgumentException - if the option is undefined or is not of the correct data type
    • getDouble

      double getDouble(String name)
      Return the value of a double option.
      Parameters:
      name - option name
      Returns:
      the double value
      Throws:
      IllegalArgumentException - if the option is undefined or is not of the correct data type
    • getString

      String getString(String name)
      Return the value of a String option.
      Parameters:
      name - option name
      Returns:
      the String value
      Throws:
      IllegalArgumentException - if the option is undefined or is not of the correct data type