Merge "Startup archetype: remove 'Impl' from config subsystem Module name."
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / RequestVoteReply.java
index 7acafecfbbd3c001a811c7377327331bb31977e1..865d4c287bd7b63cd051ef46b8db2b959f69d4b1 100644 (file)
@@ -8,19 +8,18 @@
 
 package org.opendaylight.controller.cluster.raft.messages;
 
-public class RequestVoteReply {
-
-    // currentTerm, for candidate to update itself
-    private final long term;
+public class RequestVoteReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 8427899326488775660L;
 
     // true means candidate received vot
     private final boolean voteGranted;
 
     public RequestVoteReply(long term, boolean voteGranted) {
-        this.term = term;
+        super(term);
         this.voteGranted = voteGranted;
     }
 
+    @Override
     public long getTerm() {
         return term;
     }
@@ -28,4 +27,11 @@ public class RequestVoteReply {
     public boolean isVoteGranted() {
         return voteGranted;
     }
+
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("RequestVoteReply [term=").append(term).append(", voteGranted=").append(voteGranted).append("]");
+        return builder.toString();
+    }
 }