*/
package org.opendaylight.yangtools.yang.data.impl;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.CompositeNode;
-import org.opendaylight.yangtools.yang.data.api.ModifyAction;
-import org.opendaylight.yangtools.yang.data.api.Node;
-import org.opendaylight.yangtools.yang.data.api.NodeModification;
+import org.opendaylight.yangtools.yang.data.api.*;
+
+import java.net.URI;
+import java.util.Map;
/**
* @author michal.rehak
* @param <T>
* type of node value
- *
+ *
*/
public abstract class AbstractNodeTO<T> implements Node<T>, NodeModification {
* @param value
*/
public AbstractNodeTO(QName qname, CompositeNode parent, T value) {
- this.qName = qname;
- this.parent = parent;
- this.value = value;
+ this(qname, parent, value, null);
}
/**
.getLocalName(), getModificationAction() == null ? "n/a" : getModificationAction()));
return out.toString();
}
-
-
+
+
@Override
public final QName getKey() {
return getNodeType();
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((modifyAction == null) ? 0 : modifyAction.hashCode());
result = prime * result + ((qName == null) ? 0 : qName.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result % 2;
}
@SuppressWarnings("unchecked")
AbstractNodeTO<T> other = (AbstractNodeTO<T>) obj;
- if (modifyAction != other.modifyAction) {
- return false;
- }
if (parent == null) {
if (other.parent != null) {
return false;