com.netflix.config
Class ChainedDynamicProperty.ChainLink<T>

java.lang.Object
  extended by com.netflix.config.ChainedDynamicProperty.ChainLink<T>
All Implemented Interfaces:
Property<T>
Direct Known Subclasses:
ChainedDynamicProperty.BooleanProperty, ChainedDynamicProperty.FloatProperty, ChainedDynamicProperty.IntProperty, ChainedDynamicProperty.LongProperty, ChainedDynamicProperty.StringProperty
Enclosing class:
ChainedDynamicProperty

public abstract static class ChainedDynamicProperty.ChainLink<T>
extends java.lang.Object
implements Property<T>


Constructor Summary
ChainedDynamicProperty.ChainLink(ChainedDynamicProperty.ChainLink<T> nextProperty)
           
ChainedDynamicProperty.ChainLink(T defaultValue)
          Used for end node
 
Method Summary
 void addCallback(java.lang.Runnable r)
          Add the callback to be triggered when the value of the property is changed
protected  void checkAndFlip()
           
 T get()
           
 long getChangedTimestamp()
          Gets the time (in milliseconds past the epoch) when the property was last set/changed.
 T getDefaultValue()
          Get the default property value specified at creation time
 java.lang.String getName()
          Get the name of the property
protected abstract  Property<T> getReferencedProperty()
          Get the property referenced by this ChainLink
 T getValue()
          Get the latest value for the given property
abstract  boolean isValueAcceptable()
           
 void removeAllCallbacks()
          Remove callback from callbacks list
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedDynamicProperty.ChainLink

public ChainedDynamicProperty.ChainLink(T defaultValue)
Used for end node


ChainedDynamicProperty.ChainLink

public ChainedDynamicProperty.ChainLink(ChainedDynamicProperty.ChainLink<T> nextProperty)
Parameters:
nextProperty -
Method Detail

isValueAcceptable

public abstract boolean isValueAcceptable()
Returns:
Boolean

getReferencedProperty

protected abstract Property<T> getReferencedProperty()
Get the property referenced by this ChainLink

Returns:
the referenced property

checkAndFlip

protected void checkAndFlip()

get

public T get()
Returns:
T

getValue

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

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

getDefaultValue

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

Specified by:
getDefaultValue in interface Property<T>
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<T>
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<T>

addCallback

public void addCallback(java.lang.Runnable r)
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<T>
Parameters:
r -

removeAllCallbacks

public void removeAllCallbacks()
Remove callback from callbacks list

Specified by:
removeAllCallbacks in interface Property<T>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
String