Class Option<T>

  • Type Parameters:
    T - The type of value associated with the option.

    public final class Option<T>
    extends Object
    A configuration option whose value can be stored in a set of Options. Refer to the appropriate class for the list of supported options.
    • Method Detail

      • of

        public static <T> Option<T> of​(Class<T> type,
                                       T defaultValue)
        Defines an option with the provided type and default value.
        Type Parameters:
        T - The type of value associated with the option.
        Parameters:
        type - The type of value associated with the option.
        defaultValue - The default value for the option.
        Returns:
        An option with the provided type and default value.
      • withDefault

        public static <T> Option<T> withDefault​(T defaultValue)
        Defines a boolean option with the provided default value.
        Type Parameters:
        T - The type of value associated with the option.
        Parameters:
        defaultValue - The default value for the option.
        Returns:
        A boolean option with the provided default value.
      • getDefaultValue

        public T getDefaultValue()
        Returns the default value of this Option, can be null.
        Returns:
        the default value of this Option, can be null.