Mods/improvements to NetconfNodeActorTest et al
[netconf.git] / netconf / netconf-topology-singleton / src / main / java / org / opendaylight / netconf / topology / singleton / messages / rpc / InvokeRpcMessageReply.java
index ba658ba92f83b41db87812160987743a37a4564c..2f05f006a4aa00e0ab9cad073015d6a78399f297 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.netconf.topology.singleton.messages.rpc;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
@@ -15,25 +16,31 @@ import java.io.ObjectOutput;
 import java.io.Serializable;
 import java.util.Collection;
 import java.util.LinkedList;
+import java.util.Objects;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
 import org.opendaylight.netconf.topology.singleton.messages.NormalizedNodeMessage;
 import org.opendaylight.yangtools.yang.common.RpcError;
 
 public class InvokeRpcMessageReply implements Serializable {
     private static final long serialVersionUID = 1L;
 
+    @SuppressFBWarnings("SE_BAD_FIELD")
     private final Collection<RpcError> rpcErrors;
     private final NormalizedNodeMessage normalizedNodeMessage;
 
-    public InvokeRpcMessageReply(final NormalizedNodeMessage normalizedNodeMessage,
-                                 final Collection<RpcError> rpcErrors) {
+    public InvokeRpcMessageReply(@Nullable final NormalizedNodeMessage normalizedNodeMessage,
+                                 @Nonnull final Collection<RpcError> rpcErrors) {
         this.normalizedNodeMessage = normalizedNodeMessage;
-        this.rpcErrors = rpcErrors;
+        this.rpcErrors = Objects.requireNonNull(rpcErrors);
     }
 
+    @Nullable
     public NormalizedNodeMessage getNormalizedNodeMessage() {
         return normalizedNodeMessage;
     }
 
+    @Nonnull
     public Collection<RpcError> getRpcErrors() {
         return rpcErrors;
     }
@@ -47,7 +54,8 @@ public class InvokeRpcMessageReply implements Serializable {
 
         private InvokeRpcMessageReply invokeRpcMessageReply;
 
-        Proxy() {
+        @SuppressWarnings("checkstyle:RedundantModifier")
+        public Proxy() {
             //due to Externalizable
         }