Class IntConfigOption
java.lang.Object
dev.prozilla.pine.common.property.mutable.SimpleMutableIntProperty
dev.prozilla.pine.common.property.observable.SimpleObservableIntProperty
dev.prozilla.pine.core.state.config.option.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>
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableIntProperty
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
ConstructorsConstructorDescriptionIntConfigOption(int value) Creates a config option without a validator.IntConfigOption(int value, IntPredicate validator) Creates a config option with a validator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisValid(int value) booleanisValidValue(Integer value) Checks whether a value is a valid value for this option.voidreceive(IntConfigOption otherOption) voidreset()Resets this option to its initial value.booleanset(int value) Sets the value of this property.booleanSets the value of this option.voidtransmit(IntConfigOption otherOption) Methods inherited from class dev.prozilla.pine.common.property.observable.SimpleObservableIntProperty
addObserver, destroy, getLogger, onValueChange, removeObserver, setLoggerMethods inherited from class dev.prozilla.pine.common.property.mutable.SimpleMutableIntProperty
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.IntProperty
get, getValue, getValueOr, has, hasProperty, isZeroProperty, map, replaceNull, requireValueMethods inherited from interface dev.prozilla.pine.common.property.mutable.MutableIntProperty
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.ObservableIntProperty
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
-
IntConfigOption
public IntConfigOption(int value) Creates a config option without a validator.- Parameters:
value- Initial value
-
IntConfigOption
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 interfaceMutableIntProperty- Specified by:
setValuein interfaceMutableProperty<Integer>- Parameters:
value- New value for this option- Returns:
trueif the value was changed.
-
set
public boolean set(int value) Description copied from interface:MutableIntPropertySets the value of this property.- Specified by:
setin interfaceMutableIntProperty- Overrides:
setin classSimpleMutableIntProperty- 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<Integer>- Parameters:
value- Value to check.- Returns:
- True if the value is valid
-
isValid
public boolean isValid(int value) -
transmit
-
receive
-
reset
public void reset()Description copied from interface:ConfigOptionResets this option to its initial value.- Specified by:
resetin interfaceConfigOption<Integer>
-