com.netflix.config
Class DerivedStringProperty<D>

java.lang.Object
  extended by com.netflix.config.DerivedStringProperty<D>
All Implemented Interfaces:
Property<D>

public abstract class DerivedStringProperty<D>
extends java.lang.Object
implements Property<D>

Derives a complex value from a DynamicStringProperty.


Constructor Summary
DerivedStringProperty(java.lang.String name, java.lang.String defaultValue)
           
 
Method Summary
 void addCallback(java.lang.Runnable callback)
          Add the callback to be triggered when the value of the property is changed
protected abstract  D derive(java.lang.String value)
          Invoked when property is updated with a new value.
 D get()
          Fetches derived value.
 long getChangedTimestamp()
          Gets the time (in milliseconds past the epoch) when the property was last set/changed.
 D getDefaultValue()
          Get the default property value specified at creation time
 java.lang.String getName()
          Get the name of the property
 D getValue()
          Get the latest value for the given property
protected  void propertyChanged()
          PropertyWrapper.propertyChanged()
 void removeAllCallbacks()
          Remove all callbacks registered through this instance of property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerivedStringProperty

public DerivedStringProperty(java.lang.String name,
                             java.lang.String defaultValue)
Method Detail

get

public D get()
Fetches derived value.


getValue

public D getValue()
Description copied from interface: Property
Get the latest value for the given property

Specified by:
getValue in interface Property<D>
Returns:
the latest property value

getDefaultValue

public D getDefaultValue()
Description copied from interface: Property
Get the default property value specified at creation time

Specified by:
getDefaultValue in interface Property<D>
Returns:
the default property value

getName

public java.lang.String getName()
Description copied from interface: Property
Get the name of the property

Specified by:
getName in interface Property<D>
Returns:
the property name

getChangedTimestamp

public long getChangedTimestamp()
Description copied from interface: Property
Gets the time (in milliseconds past the epoch) when the property was last set/changed.

Specified by:
getChangedTimestamp in interface Property<D>

addCallback

public void addCallback(java.lang.Runnable callback)
Description copied from interface: Property
Add the callback to be triggered when the value of the property is changed

Specified by:
addCallback in interface Property<D>

removeAllCallbacks

public void removeAllCallbacks()
Remove all callbacks registered through this instance of property

Specified by:
removeAllCallbacks in interface Property<D>

derive

protected abstract D derive(java.lang.String value)
Invoked when property is updated with a new value. Should return the new derived value, which may be null.


propertyChanged

protected void propertyChanged()
PropertyWrapper.propertyChanged()