X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fmessages%2FExecuteRpc.java;h=dca81dc0b7bb29a069d514dca28f0650923011fb;hb=refs%2Fchanges%2F11%2F80211%2F6;hp=7579a674c13f583c15437b4741cd498ff53c452b;hpb=a58c23b491f665e6d5449e97d430a7e15d1ecda6;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java index 7579a674c1..dca81dc0b7 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2014, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -7,47 +7,45 @@ */ package org.opendaylight.controller.remote.rpc.messages; +import static java.util.Objects.requireNonNull; import com.google.common.base.MoreObjects; -import com.google.common.base.Preconditions; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.io.Serializable; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils; -import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier; +import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -/** - * @author tony - * - */ -public class ExecuteRpc implements Serializable { +public final class ExecuteRpc implements Serializable { private static final long serialVersionUID = 1128904894827335676L; + @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class " + + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class " + + "aren't serialized. FindBugs does not recognize this.") private final NormalizedNode inputNormalizedNode; private final QName rpc; - private ExecuteRpc(@Nullable final NormalizedNode inputNormalizedNode, @Nonnull final QName rpc) { - this.rpc = Preconditions.checkNotNull(rpc, "rpc Qname should not be null"); + private ExecuteRpc(final @Nullable NormalizedNode inputNormalizedNode, final @NonNull QName rpc) { + this.rpc = requireNonNull(rpc, "rpc Qname should not be null"); this.inputNormalizedNode = inputNormalizedNode; } - public static ExecuteRpc from(@Nonnull final DOMRpcIdentifier rpc, @Nullable final NormalizedNode input) { + public static ExecuteRpc from(final @NonNull DOMRpcIdentifier rpc, final @Nullable NormalizedNode input) { return new ExecuteRpc(input, rpc.getType().getLastComponent()); } - @Nullable - public NormalizedNode getInputNormalizedNode() { + public @Nullable NormalizedNode getInputNormalizedNode() { return inputNormalizedNode; } - @Nonnull - public QName getRpc() { + public @NonNull QName getRpc() { return rpc; }