X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2FCompositeNodeWrapper.java;h=96ad528a0dd3f9e0591b78b2be702e9b1d004c4c;hp=e0ae78870394223ca2a662e0d8cbfe3c64193e6f;hb=aefe82b158bc1694fe633053d04f2364bcbe67d9;hpb=94d0d20b41d64bb6696c2a573ec367fcfddc44e9 diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java index e0ae788703..96ad528a0d 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/CompositeNodeWrapper.java @@ -34,21 +34,21 @@ public final class CompositeNodeWrapper implements NodeWrapper, C private QName name; private List> values = new ArrayList<>(); - public CompositeNodeWrapper(String localName) { + public CompositeNodeWrapper(final String localName) { this.localName = Preconditions.checkNotNull(localName); } - public CompositeNodeWrapper(URI namespace, String localName) { + public CompositeNodeWrapper(final URI namespace, final String localName) { this(localName); this.namespace = namespace; } - + @Override - public void setQname(QName name) { + public void setQname(final QName name) { Preconditions.checkState(compositeNode == null, "Cannot change the object, due to data inconsistencies."); this.name = name; } - + @Override public QName getQname() { return name; @@ -71,26 +71,26 @@ public final class CompositeNodeWrapper implements NodeWrapper, C } @Override - public void setNamespace(URI namespace) { + public void setNamespace(final URI namespace) { Preconditions.checkState(compositeNode == null, "Cannot change the object, due to data inconsistencies."); this.namespace = namespace; } - public void addValue(NodeWrapper value) { + public void addValue(final NodeWrapper value) { Preconditions.checkState(compositeNode == null, "Cannot change the object, due to data inconsistencies."); values.add(value); } - public void removeValue(NodeWrapper value) { + public void removeValue(final NodeWrapper value) { Preconditions.checkState(compositeNode == null, "Cannot change the object, due to data inconsistencies."); values.remove(value); } - + public List> getValues() { Preconditions.checkState(compositeNode == null, "Data can be inconsistent."); return Collections.unmodifiableList(values); } - + @Override public boolean isChangeAllowed() { return compositeNode == null ? true : false; @@ -103,13 +103,13 @@ public final class CompositeNodeWrapper implements NodeWrapper, C Preconditions.checkNotNull(namespace); name = new QName(namespace, localName); } - + List> nodeValues = new ArrayList<>(); for (NodeWrapper nodeWrapper : values) { nodeValues.add(nodeWrapper.unwrap()); } compositeNode = NodeFactory.createMutableCompositeNode(name, null, nodeValues, null, null); - + values = null; namespace = null; localName = null; @@ -123,6 +123,7 @@ public final class CompositeNodeWrapper implements NodeWrapper, C return unwrap().getNodeType(); } + @Deprecated @Override public CompositeNode getParent() { return unwrap().getParent(); @@ -138,38 +139,42 @@ public final class CompositeNodeWrapper implements NodeWrapper, C return unwrap().getModificationAction(); } + /** + * @deprecated Use {@link #getValue()} instead. + */ + @Deprecated @Override public List> getChildren() { - return unwrap().getChildren(); + return unwrap().getValue(); } @Override - public List getCompositesByName(QName children) { + public List getCompositesByName(final QName children) { return unwrap().getCompositesByName(children); } @Override - public List getCompositesByName(String children) { + public List getCompositesByName(final String children) { return unwrap().getCompositesByName(children); } @Override - public List> getSimpleNodesByName(QName children) { + public List> getSimpleNodesByName(final QName children) { return unwrap().getSimpleNodesByName(children); } @Override - public List> getSimpleNodesByName(String children) { + public List> getSimpleNodesByName(final String children) { return unwrap().getSimpleNodesByName(children); } @Override - public CompositeNode getFirstCompositeByName(QName container) { + public CompositeNode getFirstCompositeByName(final QName container) { return unwrap().getFirstCompositeByName(container); } @Override - public SimpleNode getFirstSimpleByName(QName leaf) { + public SimpleNode getFirstSimpleByName(final QName leaf) { return unwrap().getFirstSimpleByName(leaf); } @@ -184,7 +189,7 @@ public final class CompositeNodeWrapper implements NodeWrapper, C } @Override - public List> setValue(List> value) { + public List> setValue(final List> value) { return unwrap().setValue(value); } @@ -199,32 +204,32 @@ public final class CompositeNodeWrapper implements NodeWrapper, C } @Override - public boolean containsKey(Object key) { + public boolean containsKey(final Object key) { return unwrap().containsKey(key); } @Override - public boolean containsValue(Object value) { + public boolean containsValue(final Object value) { return unwrap().containsValue(value); } @Override - public List> get(Object key) { + public List> get(final Object key) { return unwrap().get(key); } @Override - public List> put(QName key, List> value) { + public List> put(final QName key, final List> value) { return unwrap().put(key, value); } @Override - public List> remove(Object key) { + public List> remove(final Object key) { return unwrap().remove(key); } @Override - public void putAll(Map>> m) { + public void putAll(final Map>> m) { unwrap().putAll(m); }