public class DefaultDocumentTreeNode<V> extends Object implements org.onosproject.store.service.DocumentTreeNode<V>
DocumentTree node.| Constructor and Description |
|---|
DefaultDocumentTreeNode(org.onosproject.store.service.DocumentPath key,
V value,
long version,
org.onosproject.store.service.DocumentTreeNode<V> parent) |
| Modifier and Type | Method and Description |
|---|---|
org.onosproject.store.service.Versioned<V> |
addChild(String name,
V newValue,
long newVersion)
Adds a new child only if one does not exist with the name.
|
org.onosproject.store.service.DocumentTreeNode<V> |
child(String name) |
Iterator<org.onosproject.store.service.DocumentTreeNode<V>> |
children() |
boolean |
equals(Object obj) |
int |
hashCode() |
org.onosproject.store.service.DocumentTreeNode<V> |
parent() |
org.onosproject.store.service.DocumentPath |
path() |
boolean |
removeChild(String name)
Removes a child node.
|
String |
toString() |
org.onosproject.store.service.Versioned<V> |
update(V newValue,
long newVersion)
Updates the node value.
|
org.onosproject.store.service.Versioned<V> |
value() |
public org.onosproject.store.service.DocumentPath path()
path in interface org.onosproject.store.service.DocumentTreeNode<V>public org.onosproject.store.service.Versioned<V> value()
value in interface org.onosproject.store.service.DocumentTreeNode<V>public Iterator<org.onosproject.store.service.DocumentTreeNode<V>> children()
children in interface org.onosproject.store.service.DocumentTreeNode<V>public org.onosproject.store.service.DocumentTreeNode<V> child(String name)
child in interface org.onosproject.store.service.DocumentTreeNode<V>public org.onosproject.store.service.DocumentTreeNode<V> parent()
public org.onosproject.store.service.Versioned<V> addChild(String name, V newValue, long newVersion)
name - relative path name of the child nodenewValue - new value to setnewVersion - new version to setnull if no child currently exists with that relative path name.
a non null return value indicates child already exists and no modification occured.public org.onosproject.store.service.Versioned<V> update(V newValue, long newVersion)
newValue - new value to setnewVersion - new version to setpublic boolean removeChild(String name)
name - the name of child node to be removedtrue if the child set was modified as a result of this call, false otherwise