Fix modernization issues
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / md / sal / dom / broker / spi / rpc / RpcRoutingStrategy.java
index f17de220d883c666b4a13651129c92a7058a1afa..96bf5a8b64da2388b87b86a04faf94687f037a60 100644 (file)
@@ -7,8 +7,9 @@
  */
 package org.opendaylight.controller.md.sal.dom.broker.spi.rpc;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.Optional;
-import com.google.common.base.Preconditions;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
@@ -16,32 +17,32 @@ import org.opendaylight.yangtools.yang.model.api.DataSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
+@Deprecated
 public abstract class RpcRoutingStrategy implements Identifiable<QName> {
-
     private static final QName CONTEXT_REFERENCE = QName.create("urn:opendaylight:yang:extension:yang-ext",
             "2013-07-09", "context-reference").intern();
+
     private final QName identifier;
 
     private RpcRoutingStrategy(final QName identifier) {
-        this.identifier = Preconditions.checkNotNull(identifier);
+        this.identifier = requireNonNull(identifier);
     }
 
     /**
-     * Returns leaf QName in which RPC Route is stored
-     *
+     * Returns leaf QName in which RPC Route is stored.
      *
      * @return leaf QName in which RPC Route is stored
      * @throws UnsupportedOperationException If RPC is not content routed.
-     *  ({@link #isContextBasedRouted()} returned <code>false</code>)
+     *     ({@link #isContextBasedRouted()} returned <code>false</code>)
      */
     public abstract QName getLeaf();
 
     /**
-     * Returns identity QName which represents RPC Routing context
+     * Returns identity QName which represents RPC Routing context.
      *
      * @return identity QName which represents RPC Routing context
      * @throws UnsupportedOperationException If RPC is not content routed.
-     *  ({@link #isContextBasedRouted()} returned <code>false</code>)
+     *     ({@link #isContextBasedRouted()} returned <code>false</code>)
      */
     public abstract QName getContext();
 
@@ -85,8 +86,8 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
 
         private RoutedRpcStrategy(final QName identifier, final QName ctx, final QName leaf) {
             super(identifier);
-            this.context = Preconditions.checkNotNull(ctx);
-            this.leaf = Preconditions.checkNotNull(leaf);
+            this.context = requireNonNull(ctx);
+            this.leaf = requireNonNull(leaf);
         }
 
         @Override
@@ -107,7 +108,7 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
 
     private static final class GlobalRpcStrategy extends RpcRoutingStrategy {
 
-        public GlobalRpcStrategy(final QName identifier) {
+        GlobalRpcStrategy(final QName identifier) {
             super(identifier);
         }