Class FloatConfigOption

All Implemented Interfaces:
Destructible, FloatProperty, MutableFloatProperty, MutableProperty<Float>, NonNullProperty<Float>, ObservableFloatProperty, ObservableProperty<Float>, SimpleObservableProperty<Float>, Property<Float>, Transceivable<ConfigOption<Float>>, Transmittable<ConfigOption<Float>>, Functor<Float>, ConfigOption<Float>

public class FloatConfigOption extends SimpleObservableFloatProperty implements ConfigOption<Float>
  • Constructor Details

    • FloatConfigOption

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

      public FloatConfigOption(float value, FloatPredicate 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(Float value)
      Sets the value of this option.
      Specified by:
      setValue in interface MutableFloatProperty
      Specified by:
      setValue in interface MutableProperty<Float>
      Parameters:
      value - New value for this option
      Returns:
      true if the value was changed.
    • set

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

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

      public boolean isValid(float value)
    • transmit

      public void transmit(FloatConfigOption otherOption)
    • receive

      public void receive(FloatConfigOption otherOption)
    • reset

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