X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-rfc8040%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Fstreams%2Flisteners%2FListenerAdapter.java;h=c241a63281b861bdcefbf2ebac993fe60f6212db;hb=f272d576a810e186759669e97f9f5b860e43d643;hp=ac3f4aeaf7192b11c9f10f21d45af04cadd99c3a;hpb=f1d97027c57d21bc9e8d28faa1653901145193c2;p=netconf.git diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java index ac3f4aeaf7..c241a63281 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/listeners/ListenerAdapter.java @@ -7,8 +7,11 @@ */ package org.opendaylight.restconf.nb.rfc8040.streams.listeners; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkState; +import static java.util.Objects.requireNonNull; + import com.google.common.base.MoreObjects; -import com.google.common.base.Preconditions; import java.io.IOException; import java.time.Instant; import java.util.Collection; @@ -63,10 +66,10 @@ public class ListenerAdapter extends AbstractCommonSubscriber implements Cluster final NotificationOutputType outputType) { setLocalNameOfPath(path.getLastPathArgument().getNodeType().getLocalName()); - this.outputType = Preconditions.checkNotNull(outputType); - this.path = Preconditions.checkNotNull(path); - Preconditions.checkArgument(streamName != null && !streamName.isEmpty()); - this.streamName = streamName; + this.outputType = requireNonNull(outputType); + this.path = requireNonNull(path); + this.streamName = requireNonNull(streamName); + checkArgument(!streamName.isEmpty()); } @Override @@ -190,7 +193,7 @@ public class ListenerAdapter extends AbstractCommonSubscriber implements Cluster .append(normalizedNode.getIdentifier()).build(); final Optional> childrenSchemaNode = dataSchemaContextTree.findChild(yiid); - Preconditions.checkState(childrenSchemaNode.isPresent()); + checkState(childrenSchemaNode.isPresent()); boolean isNodeMixin = childrenSchemaNode.get().isMixin(); boolean isSkippedNonLeaf = getLeafNodesOnly() && !(normalizedNode instanceof LeafNode); if (!isNodeMixin && !isSkippedNonLeaf) { @@ -258,7 +261,7 @@ public class ListenerAdapter extends AbstractCommonSubscriber implements Cluster try { SchemaPath nodePath; final Optional> childrenSchemaNode = dataSchemaContextTree.findChild(eventPath); - Preconditions.checkState(childrenSchemaNode.isPresent()); + checkState(childrenSchemaNode.isPresent()); if (normalized instanceof MapEntryNode || normalized instanceof UnkeyedListEntryNode) { nodePath = childrenSchemaNode.get().getDataSchemaNode().getPath(); } else {