Package io.atomix.raft.protocol
Class VoteResponse
java.lang.Object
io.atomix.raft.protocol.AbstractRaftResponse
io.atomix.raft.protocol.VoteResponse
- All Implemented Interfaces:
RaftMessage,RaftResponse
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.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.atomix.raft.protocol.RaftResponse
RaftResponse.Status -
Field Summary
Fields inherited from class io.atomix.raft.protocol.AbstractRaftResponse
error, status -
Constructor Summary
ConstructorsConstructorDescriptionVoteResponse(RaftResponse.Status status, RaftError error, long term, boolean voted) -
Method Summary
Methods inherited from class io.atomix.raft.protocol.AbstractRaftResponse
error, status
-
Constructor Details
-
VoteResponse
-
-
Method Details
-
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:
hashCodein classAbstractRaftResponse
-
equals
- Overrides:
equalsin classAbstractRaftResponse
-
toString
- Overrides:
toStringin classAbstractRaftResponse
-