|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.config.PropertyWrapper<V>
V - The type of the DynamicPropertypublic abstract class PropertyWrapper<V>
A wrapper around DynamicProperty and associates it with a type.
| Field Summary | |
|---|---|
protected V |
defaultValue
|
protected DynamicProperty |
prop
|
| Constructor Summary | |
|---|---|
protected |
PropertyWrapper(java.lang.String propName,
V defaultValue)
|
| Method Summary | |
|---|---|
void |
addCallback(java.lang.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. |
java.lang.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(java.lang.Class<? extends PropertyWrapper<?>> c)
By default, a subclass of PropertyWrapper will automatically register propertyChanged() as a callback
for property value change. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DynamicProperty prop
protected V defaultValue
| Constructor Detail |
|---|
protected PropertyWrapper(java.lang.String propName,
V defaultValue)
| Method Detail |
|---|
public static final void registerSubClassWithNoCallback(java.lang.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 java.lang.String getName()
protected void propertyChanged()
public long getChangedTimestamp()
public void addCallback(java.lang.Runnable callback)
callback - public abstract V getValue()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||