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=f30394187125153004e9b5c3a1b4d4cb2cc74886;hb=23655e49a8048b17b8c78be16b83d19a1500f2bb;hpb=c9698a6764972f2a69a8e95d8d8eea5790e8c816 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 f303941871..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,40 +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; - -public class Rpcs { +/** + * Deprecated. + * + * @deprecated Use {@link org.opendaylight.yangtools.yang.common.RpcResultBuilder} + */ +@Deprecated +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); @@ -60,6 +61,5 @@ public class Rpcs { public Collection getErrors() { return errors; } - } }