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=5a310e8af276811980617dd416b9b7cbe15c86d8;hb=365c9751fb9b8b5464e2576c417e97be64732def;hp=f7f70e8d87ca697b5050144c56bb165976c2551c;hpb=94d0d20b41d64bb6696c2a573ec367fcfddc44e9;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 f7f70e8d87..5a310e8af2 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,20 +7,22 @@ */ 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; - +/** + * @deprecated class will be removed in Lithium release + */ +@Deprecated public final class EmptyNodeWrapper implements NodeWrapper>, Node { - + private Node unwrapped; - + private String localName; private URI namespace; private QName name; @@ -30,27 +32,27 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node public boolean isComposite() { 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; } - + @Override public QName getQname() { return name; } - + @Override public String getLocalName() { if (unwrapped != null) { @@ -58,7 +60,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } return localName; } - + @Override public URI getNamespace() { if (unwrapped != null) { @@ -68,7 +70,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 +87,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 +106,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override + @Deprecated public CompositeNode getParent() { return unwrap().getParent(); } @@ -118,7 +122,7 @@ public final class EmptyNodeWrapper implements NodeWrapper>, Node } @Override - public Void setValue(Void value) { + public Void setValue(final Void value) { return null; }