Make RequestVoteReply final
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / RequestVoteReply.java
index 7acafecfbbd3c001a811c7377327331bb31977e1..ea56aeca568784dca1e72d6f7295126bd711fdd1 100644 (file)
@@ -8,24 +8,25 @@
 
 package org.opendaylight.controller.cluster.raft.messages;
 
-public class RequestVoteReply {
+public final class RequestVoteReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 8427899326488775660L;
 
-    // currentTerm, for candidate to update itself
-    private final long term;
-
-    // true means candidate received vot
+    // true means candidate received vote
     private final boolean voteGranted;
 
     public RequestVoteReply(long term, boolean voteGranted) {
-        this.term = term;
+        super(term);
         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();
+    }
 }