Package com.yahoo.config
Class LeafNode<T>
java.lang.Object
com.yahoo.config.Node
com.yahoo.config.LeafNode<T>
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
BooleanNode,DoubleNode,EnumNode,FileNode,IntegerNode,LongNode,ModelNode,OptionalPathNode,PathNode,ReferenceNode,StringNode,UrlNode
Superclass for all leaf nodes in a
ConfigInstance.
Subclasses represent leaf nodes with different types. These implementations should implement method value() with return-value corresponding to the actual type.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LeafNode<?>clone()This method is meant for internal use in the configuration system.protected abstract booleandoSetValue(String value) booleanabstract StringgetValue()Subclasses must implement this, in compliance with the rules given in the return tag.inthashCode()protected final booleanSets the value based on a string representation.abstract StringtoString()Subclasses must implement this, in compliance with the rules given in the return tag.value()Methods inherited from class com.yahoo.config.Node
postInitialize
-
Field Details
-
initialized
protected boolean initialized -
value
-
-
Constructor Details
-
LeafNode
protected LeafNode()Creates a new, uninitialized LeafNode -
LeafNode
protected LeafNode(boolean initialized) Creates a new LeafNode.- Parameters:
initialized- true if this node is initialized.
-
-
Method Details
-
value
-
toString
Subclasses must implement this, in compliance with the rules given in the return tag. -
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
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:
IllegalArgumentException- when value is null
-
doSetValue
-
clone
This method is meant for internal use in the configuration system. Overrides Object.clone(). -
equals
-
hashCode
public int hashCode()
-