Deprecate Broker and related APIs
[controller.git] / opendaylight / md-sal / sal-common-util / src / main / java / org / opendaylight / controller / sal / common / util / Rpcs.java
index 69458b6a6d6e3492ed484c958bd3380e049bff0f..3278cef19844ae4e62c9a9e02c7b18a472757614 100644 (file)
@@ -7,44 +7,41 @@
  */
 package org.opendaylight.controller.sal.common.util;
 
-import java.io.Serializable;
+import com.google.common.collect.ImmutableList;
 import java.util.Collection;
-
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
-import com.google.common.collect.ImmutableList;
-
 /**
+ * Deprecated.
+ *
  * @deprecated Use {@link org.opendaylight.yangtools.yang.common.RpcResultBuilder}
  */
 @Deprecated
-public class Rpcs {
+public final class Rpcs {
+    private Rpcs() {
+    }
 
     public static <T> RpcResult<T> getRpcResult(boolean successful) {
-        RpcResult<T> ret = new RpcResultTO<T>(successful, null, ImmutableList.<RpcError>of());
-        return ret;
+        return new RpcResultTO<>(successful, null, ImmutableList.of());
     }
 
     public static <T> RpcResult<T> getRpcResult(boolean successful, T result,
             Collection<RpcError> errors) {
-        RpcResult<T> ret = new RpcResultTO<T>(successful, result, errors);
-        return ret;
+        return new RpcResultTO<>(successful, result, errors);
     }
 
     public static <T> RpcResult<T> getRpcResult(boolean successful, Collection<RpcError> errors) {
-        return new RpcResultTO<T>(successful, null, errors);
+        return new RpcResultTO<>(successful, null, errors);
     }
 
-    private static class RpcResultTO<T> implements RpcResult<T>, Serializable, Immutable {
-        private static final long serialVersionUID = 1L;
+    private static class RpcResultTO<T> implements RpcResult<T>, Immutable {
         private final Collection<RpcError> errors;
         private final T result;
         private final boolean successful;
 
-        public RpcResultTO(boolean successful, T result,
-                Collection<RpcError> errors) {
+        RpcResultTO(boolean successful, T result, Collection<RpcError> errors) {
             this.successful = successful;
             this.result = result;
             this.errors = ImmutableList.copyOf(errors);
@@ -64,6 +61,5 @@ public class Rpcs {
         public Collection<RpcError> getErrors() {
             return errors;
         }
-
     }
 }