Interface ConfigOption<T>

Type Parameters:
T - The type of the value
All Superinterfaces:
Destructible, Functor<T>, MutableProperty<T>, ObservableProperty<T>, Property<T>, SimpleObservableProperty<T>, Transceivable<ConfigOption<T>>, Transmittable<ConfigOption<T>>
All Known Implementing Classes:
BooleanConfigOption, FloatConfigOption, IntConfigOption, ObjectConfigOption, StringConfigOption

public interface ConfigOption<T> extends SimpleObservableProperty<T>, Transceivable<ConfigOption<T>>
Represents an option of the application's configuration.

Every option has an initial value and a validator which restricts the values of the option.

See Also:
  • Field Details

  • Method Details

    • transmit

      default void transmit(ConfigOption<T> target)
      Copies the value of this option to another option.
      Specified by:
      transmit in interface Transceivable<T>
      Specified by:
      transmit in interface Transmittable<T>
      Parameters:
      target - The target object to transmit data to
    • receive

      default void receive(ConfigOption<T> source)
      Copies the value of another option to this option.
      Specified by:
      receive in interface Transceivable<T>
      Parameters:
      source - The object from which data will be received
    • isValidValue

      boolean isValidValue(T value)
      Checks whether a value is a valid value for this option.
      Parameters:
      value - Value to check.
      Returns:
      True if the value is valid
    • reset

      void reset()
      Resets this option to its initial value.
    • self

      default ConfigOption<T> self()
      Specified by:
      self in interface Transceivable<T>