Class ConfigOption<T>

java.lang.Object
ai.dat.core.configuration.ConfigOption<T>
Type Parameters:
T - The type of value associated with the configuration option.

public class ConfigOption<T> extends Object
A ConfigOption describes a configuration parameter. It encapsulates the configuration key, and an optional default value for the configuration parameter.

ConfigOptions are built via the ConfigOptions class. Once created, a config option is immutable.

  • Method Details

    • withDescription

      public ConfigOption<T> withDescription(String description)
      Creates a new config option, using this option's key and default value, and adding the given description. The given description is used when generation the configuration documentation.
      Parameters:
      description - The description for this option.
      Returns:
      A new config option, with given description.
    • withDescription

      public ConfigOption<T> withDescription(Description description)
      Creates a new config option, using this option's key and default value, and adding the given description. The given description is used when generation the configuration documentation.
      Parameters:
      description - The description for this option.
      Returns:
      A new config option, with given description.
    • key

      public String key()
      Gets the configuration key.
      Returns:
      The configuration key
    • hasDefaultValue

      public boolean hasDefaultValue()
      Checks if this option has a default value.
      Returns:
      True if it has a default value, false if not.
    • defaultValue

      public T defaultValue()
      Returns the default value, or null, if there is no default value.
      Returns:
      The default value, or null.
    • description

      public Description description()
      Returns the description of this option.
      Returns:
      The option's description.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object