Package com.avanza.astrix.config
Class DynamicBooleanProperty
- java.lang.Object
-
- com.avanza.astrix.config.DynamicBooleanProperty
-
- All Implemented Interfaces:
DynamicProperty<Boolean>,BooleanSupplier
public final class DynamicBooleanProperty extends Object implements DynamicProperty<Boolean>, BooleanSupplier
DynamicProperty of boolean type, seeDynamicProperty.- Author:
- Elias Lindholm (elilin)
-
-
Constructor Summary
Constructors Constructor Description DynamicBooleanProperty()DynamicBooleanProperty(boolean value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(DynamicPropertyListener<Boolean> listener)Adds a given listener to the underlying property.booleanget()booleangetAsBoolean()BooleangetCurrentValue()Returns the current value of this DynamicProperty.voidremoveListener(DynamicPropertyListener<Boolean> listener)Removes a given listener.voidset(boolean value)voidsetValue(Boolean value)Sets the value of this DynamicProperty.StringtoString()
-
-
-
Method Detail
-
getCurrentValue
public Boolean getCurrentValue()
Description copied from interface:DynamicPropertyReturns the current value of this DynamicProperty. For primitive types the boxed version is returned (never null).- Specified by:
getCurrentValuein interfaceDynamicProperty<Boolean>
-
get
public boolean get()
-
getAsBoolean
public boolean getAsBoolean()
- Specified by:
getAsBooleanin interfaceBooleanSupplier
-
set
public void set(boolean value)
-
setValue
public void setValue(Boolean value)
Description copied from interface:DynamicPropertySets the value of this DynamicProperty. If the underlying property is a primitive type then this method throwsNullPointerExceptionwhen passing a null argument. All other DynamicProperty types accepts null as a value.- Specified by:
setValuein interfaceDynamicProperty<Boolean>
-
addListener
public void addListener(DynamicPropertyListener<Boolean> listener)
Description copied from interface:DynamicPropertyAdds a given listener to the underlying property. The listener will be notified each time the property value changes.Events are not guaranteed to be received in the same order as the underlying property is set.
The listener will be notified synchronously on the same thread that mutates the underlying property, so don't do any long-running work on the thread that notifies the
DynamicPropertyListener.- Specified by:
addListenerin interfaceDynamicProperty<Boolean>
-
removeListener
public void removeListener(DynamicPropertyListener<Boolean> listener)
Description copied from interface:DynamicPropertyRemoves a given listener. After remove the given listener will not receive events when this property is changed.- Specified by:
removeListenerin interfaceDynamicProperty<Boolean>
-
-