Package de.mhus.lib.core.cfg
Class CfgValue<T>
- java.lang.Object
-
- de.mhus.lib.core.cfg.CfgValue<T>
-
- Direct Known Subclasses:
CfgBigDecimal,CfgBoolean,CfgDouble,CfgFile,CfgInt,CfgLong,CfgNode,CfgProperties,CfgSecure,CfgString,CfgTimeInterval
public abstract class CfgValue<T> extends Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object in)StringgetCalling()TgetDefault()StringgetOwner()StringgetPath()longgetUpdated()booleanisOwner(Class<?> name)booleanisOwner(String name)protected abstract TloadValue()protected abstract TloadValue(String value)protected voidonPostUpdate(T newValue)protected voidonPreUpdate(T newValue)voidsetValue(String v)StringtoString()<C extends CfgValue<T>>
CupdateAction(Consumer<T> consumer)Set the onPostUpdate action.Tvalue()
-
-
-
Method Detail
-
value
public T value()
-
getPath
public String getPath()
-
getOwner
public String getOwner()
-
getDefault
public T getDefault()
-
loadValue
protected abstract T loadValue()
-
onPreUpdate
protected void onPreUpdate(T newValue)
-
onPostUpdate
protected void onPostUpdate(T newValue)
-
isOwner
public boolean isOwner(Class<?> name)
-
isOwner
public boolean isOwner(String name)
-
setValue
public void setValue(String v)
-
updateAction
public <C extends CfgValue<T>> C updateAction(Consumer<T> consumer)
Set the onPostUpdate action. The action will be executed on every update.- Parameters:
consumer-- Returns:
- the called object
-
getUpdated
public long getUpdated()
-
getCalling
public String getCalling()
-
-