public class VoteResponse extends AbstractRaftResponse
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
VoteResponse.Builder
Poll response builder.
|
RaftResponse.Status| Constructor and Description |
|---|
VoteResponse(RaftResponse.Status status,
RaftError error,
long term,
boolean voted) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object) |
int |
hashCode() |
static VoteResponse.Builder |
newBuilder()
Returns a new vote response builder.
|
long |
term()
Returns the responding node's current term.
|
String |
toString() |
boolean |
voted()
Returns a boolean indicating whether the vote was granted.
|
error, statuspublic VoteResponse(RaftResponse.Status status, RaftError error, long term, boolean voted)
public static VoteResponse.Builder newBuilder()
public long term()
public boolean voted()
public int hashCode()
hashCode in class AbstractRaftResponsepublic boolean equals(Object object)
equals in class AbstractRaftResponsepublic String toString()
toString in class AbstractRaftResponseCopyright © 2013–2017. All rights reserved.