Suppress modernization
[controller.git] / opendaylight / md-sal / sal-dom-spi / src / main / java / org / opendaylight / controller / md / sal / dom / broker / spi / rpc / RpcRoutingStrategy.java
index f17de220d883c666b4a13651129c92a7058a1afa..f55cb87e51b6c786337fe1288150fa7aaa576b87 100644 (file)
@@ -7,8 +7,10 @@
  */
 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.gaul.modernizer_maven_annotations.SuppressModernizer;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
@@ -16,32 +18,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();
 
@@ -70,6 +72,7 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
         return new GlobalRpcStrategy(rpc.getQName());
     }
 
+    @SuppressModernizer
     public static Optional<QName> getRoutingContext(final DataSchemaNode schemaNode) {
         for (UnknownSchemaNode extension : schemaNode.getUnknownSchemaNodes()) {
             if (CONTEXT_REFERENCE.equals(extension.getNodeType())) {
@@ -85,8 +88,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
@@ -106,8 +109,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);
         }