X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcommon%2Futil%2FRpcs.java;h=3278cef19844ae4e62c9a9e02c7b18a472757614;hp=69458b6a6d6e3492ed484c958bd3380e049bff0f;hb=23655e49a8048b17b8c78be16b83d19a1500f2bb;hpb=605e93859db80e6d0858a26046ee446f9fb967d6 diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java index 69458b6a6d..3278cef198 100644 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java @@ -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 RpcResult getRpcResult(boolean successful) { - RpcResult ret = new RpcResultTO(successful, null, ImmutableList.of()); - return ret; + return new RpcResultTO<>(successful, null, ImmutableList.of()); } public static RpcResult getRpcResult(boolean successful, T result, Collection errors) { - RpcResult ret = new RpcResultTO(successful, result, errors); - return ret; + return new RpcResultTO<>(successful, result, errors); } public static RpcResult getRpcResult(boolean successful, Collection errors) { - return new RpcResultTO(successful, null, errors); + return new RpcResultTO<>(successful, null, errors); } - private static class RpcResultTO implements RpcResult, Serializable, Immutable { - private static final long serialVersionUID = 1L; + private static class RpcResultTO implements RpcResult, Immutable { private final Collection errors; private final T result; private final boolean successful; - public RpcResultTO(boolean successful, T result, - Collection errors) { + RpcResultTO(boolean successful, T result, Collection errors) { this.successful = successful; this.result = result; this.errors = ImmutableList.copyOf(errors); @@ -64,6 +61,5 @@ public class Rpcs { public Collection getErrors() { return errors; } - } }