+ * Returns the id of the candidate that this server voted for in current term.
+ *
+ * @return candidate id that received the vote or null if no candidate was voted for.
+ */
+ @Nullable String getVotedFor();
+
+ /**
+ * This method updates the in-memory election term state. This method should be called when recovering election
+ * state from persistent storage.
+ *
+ * @param term the election term.
+ * @param votedFor the candidate id that was voted for.