Class ObjectConfigOption<T>

All Implemented Interfaces:
Destructible, MutableObjectProperty<T>, MutableProperty<T>, ObservableObjectProperty<T>, ObservableProperty<T>, SimpleObservableProperty<T>, Property<T>, Transceivable<ConfigOption<T>>, Transmittable<ConfigOption<T>>, Functor<T>, ConfigOption<T>
Direct Known Subclasses:
StringConfigOption

public class ObjectConfigOption<T> extends SimpleObservableObjectProperty<T> implements ConfigOption<T>
  • Constructor Details

    • ObjectConfigOption

      public ObjectConfigOption(T value)
      Creates a config option without a validator.
      Parameters:
      value - Initial value
    • ObjectConfigOption

      public ObjectConfigOption(T value, Predicate<T> validator) throws IllegalArgumentException
      Creates a config option with a validator.
      Parameters:
      value - Initial value
      Throws:
      IllegalArgumentException - If validator does not evaluate to true for the initial value.
  • Method Details

    • setValue

      public boolean setValue(T value)
      Description copied from interface: MutableProperty
      Sets the value of this property.
      Specified by:
      setValue in interface MutableProperty<T>
      Overrides:
      setValue in class SimpleMutableObjectProperty<T>
      Parameters:
      value - The new value
      Returns:
      true if the value was changed.
    • isValidValue

      public boolean isValidValue(T value)
      Description copied from interface: ConfigOption
      Checks whether a value is a valid value for this option.
      Specified by:
      isValidValue in interface ConfigOption<T>
      Parameters:
      value - Value to check.
      Returns:
      True if the value is valid
    • reset

      public void reset()
      Description copied from interface: ConfigOption
      Resets this option to its initial value.
      Specified by:
      reset in interface ConfigOption<T>