Class FloatConfigOption
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableFloatProperty
dev.prozilla.pine.common.property.observable.SimpleObservableFloatProperty
dev.prozilla.pine.core.state.config.option.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>
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableFloatProperty
loggerFields inherited from interface dev.prozilla.pine.core.state.config.option.ConfigOption
INITIAL_VALUE_ERRORFields inherited from interface dev.prozilla.pine.common.property.observable.ObservableProperty
OBSERVER_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionFloatConfigOption(float value) Creates a config option without a validator.FloatConfigOption(float value, FloatPredicate validator) Creates a config option with a validator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(float value) booleanisValidValue(Float value) Checks whether a value is a valid value for this option.voidreceive(FloatConfigOption otherOption) voidreset()Resets this option to its initial value.booleanset(float value) Sets the value of this property.booleanSets the value of this option.voidtransmit(FloatConfigOption otherOption) Methods inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableFloatProperty
addObserver, destroy, getLogger, onValueChange, removeObserver, setLoggerMethods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableFloatProperty
getMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.state.config.option.ConfigOption
receive, self, transmitMethods inherited from interface dev.prozilla.pine.common.lifecycle.Destructible
destroyMethods inherited from interface dev.prozilla.pine.common.property.FloatProperty
get, getValue, getValueOr, has, hasProperty, isZeroProperty, map, replaceNull, requireValueMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableFloatProperty
modify, swap, viewPropertyMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableProperty
modifyValue, swapValueMethods inherited from interface dev.prozilla.pine.common.property.NonNullProperty
isNotNull, isNotNullPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.ObservableFloatProperty
addObserver, read, read, removeObserverMethods inherited from interface dev.prozilla.pine.common.property.Property
hasValue, hasValueProperty, isNull, map, snapshot, toStringPropertyMethods inherited from interface dev.prozilla.pine.common.property.observable.SimpleObservableProperty
setLogger
-
Constructor Details
-
FloatConfigOption
public FloatConfigOption(float value) Creates a config option without a validator.- Parameters:
value- Initial value
-
FloatConfigOption
Creates a config option with a validator.- Parameters:
value- Initial value- Throws:
IllegalArgumentException- Ifvalidatordoes not evaluate totruefor the initial value.
-
-
Method Details
-
setValue
Sets the value of this option.- Specified by:
setValuein interfaceMutableFloatProperty- Specified by:
setValuein interfaceMutableProperty<Float>- Parameters:
value- New value for this option- Returns:
trueif the value was changed.
-
set
public boolean set(float value) Description copied from interface:MutableFloatPropertySets the value of this property.- Specified by:
setin interfaceMutableFloatProperty- Overrides:
setin classSimpleMutableFloatProperty- Parameters:
value- The new value- Returns:
trueif the value was changed.
-
isValidValue
Description copied from interface:ConfigOptionChecks whether a value is a valid value for this option.- Specified by:
isValidValuein interfaceConfigOption<Float>- Parameters:
value- Value to check.- Returns:
- True if the value is valid
-
isValid
public boolean isValid(float value) -
transmit
-
receive
-
reset
public void reset()Description copied from interface:ConfigOptionResets this option to its initial value.- Specified by:
resetin interfaceConfigOption<Float>
-