Make RequestVoteReply final
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / RequestVoteReply.java
index a658ab7d810685c53b90ed6955ce5df5273b1b10..ea56aeca568784dca1e72d6f7295126bd711fdd1 100644 (file)
@@ -8,11 +8,10 @@
 
 package org.opendaylight.controller.cluster.raft.messages;
 
-import java.io.Serializable;
+public final class RequestVoteReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 8427899326488775660L;
 
-public class RequestVoteReply extends AbstractRaftRPC implements Serializable {
-
-    // true means candidate received vot
+    // true means candidate received vote
     private final boolean voteGranted;
 
     public RequestVoteReply(long term, boolean voteGranted) {
@@ -20,11 +19,14 @@ public class RequestVoteReply extends AbstractRaftRPC implements Serializable {
         this.voteGranted = voteGranted;
     }
 
-    public long getTerm() {
-        return term;
-    }
-
     public boolean isVoteGranted() {
         return voteGranted;
     }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("RequestVoteReply [term=").append(getTerm()).append(", voteGranted=").append(voteGranted).append("]");
+        return builder.toString();
+    }
 }