Class VoteResponse

All Implemented Interfaces:
RaftMessage, RaftResponse

public class VoteResponse extends AbstractRaftResponse
Server vote response.

Vote responses are sent by active servers in response to vote requests by candidate to indicate whether the responding server voted for the requesting candidate. This is indicated by the voted() field of the response.

  • Constructor Details

  • Method Details

    • builder

      public static VoteResponse.Builder builder()
      Returns a new vote response builder.
      Returns:
      A new vote response builder.
    • term

      public long term()
      Returns the responding node's current term.
      Returns:
      The responding node's current term.
    • voted

      public boolean voted()
      Returns a boolean indicating whether the vote was granted.
      Returns:
      Indicates whether the vote was granted.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractRaftResponse
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class AbstractRaftResponse
    • toString

      public String toString()
      Overrides:
      toString in class AbstractRaftResponse