V
- The type of the DynamicPropertypublic abstract class PropertyWrapper<V> extends Object
Modifier and Type | Field and Description |
---|---|
protected V |
defaultValue |
protected DynamicProperty |
prop |
Modifier | Constructor and Description |
---|---|
protected |
PropertyWrapper(String propName,
V defaultValue) |
Modifier and Type | Method and Description |
---|---|
void |
addCallback(Runnable callback)
Add the callback to be triggered when the value of the property is changed
|
long |
getChangedTimestamp()
Gets the time (in milliseconds past the epoch) when the property
was last set/changed.
|
String |
getName() |
abstract V |
getValue()
Get current typed value of the property.
|
protected void |
propertyChanged()
Called when the property value is updated.
|
static void |
registerSubClassWithNoCallback(Class<? extends PropertyWrapper<?>> c)
By default, a subclass of PropertyWrapper will automatically register
propertyChanged() as a callback
for property value change. |
String |
toString() |
protected DynamicProperty prop
protected V defaultValue
public static final void registerSubClassWithNoCallback(Class<? extends PropertyWrapper<?>> c)
propertyChanged()
as a callback
for property value change. This method provide a way for a subclass to avoid this overhead if it is not interested
to get callback.c
- public String getName()
protected void propertyChanged()
public long getChangedTimestamp()
public void addCallback(Runnable callback)
callback
- public abstract V getValue()
Copyright © 2017. All Rights Reserved.