X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2FEmptyNodeWrapper.java;h=a3d44d3572106232e10edaad73e91d1b4d46039a;hb=refs%2Fchanges%2F27%2F8927%2F3;hp=934d4434c38a3e724279405da05198099eba2f70;hpb=0a2c659c014737c7e12a39001310de14d5f85149;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java index 934d4434c3..a3d44d3572 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/EmptyNodeWrapper.java @@ -7,16 +7,14 @@ */ package org.opendaylight.controller.sal.restconf.impl; +import com.google.common.base.Preconditions; import java.net.URI; import java.util.Collections; - import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.opendaylight.yangtools.yang.data.api.Node; import org.opendaylight.yangtools.yang.data.impl.NodeFactory; -import com.google.common.base.Preconditions; - public final class EmptyNodeWrapper implements NodeWrapper>, Node { private Node unwrapped; @@ -31,17 +29,17 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node return composite; } - public void setComposite(boolean composite) { + public void setComposite(final boolean composite) { this.composite = composite; } - public EmptyNodeWrapper(URI namespace, String localName) { + public EmptyNodeWrapper(final URI namespace, final String localName) { this.localName = Preconditions.checkNotNull(localName); this.namespace = namespace; } @Override - public void setQname(QName name) { + public void setQname(final QName name) { Preconditions.checkState(unwrapped == null, "Cannot change the object, due to data inconsistencies."); this.name = name; } @@ -68,7 +66,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override - public void setNamespace(URI namespace) { + public void setNamespace(final URI namespace) { Preconditions.checkState(unwrapped == null, "Cannot change the object, due to data inconsistencies."); this.namespace = namespace; } @@ -85,8 +83,9 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node Preconditions.checkNotNull(namespace); name = new QName(namespace, localName); } - if(composite) { - unwrapped = NodeFactory.createImmutableCompositeNode(name, null, Collections.>emptyList(),null); + if (composite) { + unwrapped = NodeFactory.createImmutableCompositeNode(name, null, Collections.> emptyList(), + null); } else { unwrapped = NodeFactory.createImmutableSimpleNode(name, null, null); } @@ -103,6 +102,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override + @Deprecated public CompositeNode getParent() { return unwrap().getParent(); } @@ -118,7 +118,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override - public Void setValue(Void value) { + public Void setValue(final Void value) { return null; }