Class IntConfigOption

All Implemented Interfaces:
Destructible, IntProperty, MutableIntProperty, MutableProperty<Integer>, NonNullProperty<Integer>, ObservableIntProperty, ObservableProperty<Integer>, SimpleObservableProperty<Integer>, Property<Integer>, Transceivable<ConfigOption<Integer>>, Transmittable<ConfigOption<Integer>>, Functor<Integer>, ConfigOption<Integer>

public class IntConfigOption extends SimpleObservableIntProperty implements ConfigOption<Integer>
  • Constructor Details

    • IntConfigOption

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

      public IntConfigOption(int value, IntPredicate 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(Integer value)
      Sets the value of this option.
      Specified by:
      setValue in interface MutableIntProperty
      Specified by:
      setValue in interface MutableProperty<Integer>
      Parameters:
      value - New value for this option
      Returns:
      true if the value was changed.
    • set

      public boolean set(int value)
      Description copied from interface: MutableIntProperty
      Sets the value of this property.
      Specified by:
      set in interface MutableIntProperty
      Overrides:
      set in class SimpleMutableIntProperty
      Parameters:
      value - The new value
      Returns:
      true if the value was changed.
    • isValidValue

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

      public boolean isValid(int value)
    • transmit

      public void transmit(IntConfigOption otherOption)
    • receive

      public void receive(IntConfigOption otherOption)
    • reset

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