Package com.yahoo.config
Class LeafNode<T>
- java.lang.Object
-
- com.yahoo.config.Node
-
- com.yahoo.config.LeafNode<T>
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
BooleanNode
,DoubleNode
,EnumNode
,FileNode
,IntegerNode
,LongNode
,PathNode
,ReferenceNode
,StringNode
,UrlNode
public abstract class LeafNode<T> extends Node implements java.lang.Cloneable
Superclass for all leaf nodes in aConfigInstance
.Subclasses represents leaf nodes with different types. These implementations should implement method value() with return-value corresponding to the actual type.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
initialized
protected T
value
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
clone()
This method is meant for internal use in the configuration system.protected abstract boolean
doSetValue(java.lang.String value)
boolean
equals(java.lang.Object o)
abstract java.lang.String
getValue()
Subclasses must implement this, in compliance with the rules given in the return tag.int
hashCode()
protected boolean
setValue(java.lang.String value)
Sets the value based on a string representation.abstract java.lang.String
toString()
Subclasses must implement this, in compliance with the rules given in the return tag.T
value()
-
Methods inherited from class com.yahoo.config.Node
postInitialize
-
-
-
-
Field Detail
-
initialized
protected boolean initialized
-
value
protected T value
-
-
Method Detail
-
value
public T value()
-
toString
public abstract java.lang.String toString()
Subclasses must implement this, in compliance with the rules given in the return tag.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the String representation of the node value, or the string "(null)" if the value is null.
-
getValue
public abstract java.lang.String getValue()
Subclasses must implement this, in compliance with the rules given in the return tag.- Returns:
- the String representation of the node value, or the 'null' object if the node value is null.
-
setValue
protected final boolean setValue(java.lang.String value)
Sets the value based on a string representation. Returns false if the value could not be set from the given string. TODO: return void (see doSetValue)- Parameters:
value
- the value to set- Returns:
- true on success, false otherwise
- Throws:
java.lang.IllegalArgumentException
- when value is null
-
doSetValue
protected abstract boolean doSetValue(java.lang.String value)
-
clone
protected java.lang.Object clone()
This method is meant for internal use in the configuration system. Overrides Object.clone().
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-