Make FollowerInitialSyncUpStatus final 13/34613/4
authorRobert Varga <rovarga@cisco.com>
Sat, 13 Feb 2016 23:24:06 +0000 (00:24 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 15 Feb 2016 14:08:09 +0000 (14:08 +0000)
Change-Id: Ie39c26f077311e0ec5b9dd9b8734bdfabf26b581
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/FollowerInitialSyncUpStatus.java

index 72b5ac9..d2100cb 100644 (file)
@@ -8,28 +8,30 @@
 
 package org.opendaylight.controller.cluster.raft.base.messages;
 
+import com.google.common.base.Preconditions;
+import javax.annotation.Nonnull;
+
 /**
  * The FollowerInitialSyncUpStatus is sent by a Follower to inform any RaftActor subclass whether the Follower
  * is at least at the same commitIndex as the Leader was when it sent the follower the very first heartbeat.
  *
  * This status can be used to determine if a Follower has caught up with the current Leader in an upgrade scenario
  * for example.
- *
  */
-public class FollowerInitialSyncUpStatus {
+public final class FollowerInitialSyncUpStatus {
     private final boolean initialSyncDone;
     private final String name;
 
-    public FollowerInitialSyncUpStatus(boolean initialSyncDone, String name){
+    public FollowerInitialSyncUpStatus(final boolean initialSyncDone, @Nonnull final String name) {
         this.initialSyncDone = initialSyncDone;
-        this.name = name;
+        this.name = Preconditions.checkNotNull(name);
     }
 
     public boolean isInitialSyncDone() {
         return initialSyncDone;
     }
 
-    public String getName() {
+    @Nonnull public String getName() {
         return name;
     }
 }