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=356ec8ff7c5ee6e84692970d702910b7bdc8c091;hb=23655e49a8048b17b8c78be16b83d19a1500f2bb;hpb=c541f7868e6e2d654b8080b5426bb12a39bddf11 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 356ec8ff7c..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,42 +7,41 @@ */ package org.opendaylight.controller.sal.common.util; -import java.io.Serializable; -import java.util.ArrayList; +import com.google.common.collect.ImmutableList; import java.util.Collection; -import java.util.Collections; - 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 final class Rpcs { + private Rpcs() { + } -public class 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 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); @@ -62,6 +61,5 @@ public class Rpcs { public Collection getErrors() { return errors; } - } }