public static class VoteRequest.Builder extends AbstractRequest.Builder<VoteRequest.Builder,VoteRequest>
| Modifier and Type | Method and Description |
|---|---|
VoteRequest |
build() |
boolean |
equals(Object object) |
int |
hashCode() |
String |
toString() |
VoteRequest.Builder |
withCandidate(int candidate)
Sets the request leader.
|
VoteRequest.Builder |
withLogIndex(long index)
Sets the request last log index.
|
VoteRequest.Builder |
withLogTerm(long term)
Sets the request last log term.
|
VoteRequest.Builder |
withTerm(long term)
Sets the request term.
|
public VoteRequest.Builder withTerm(long term)
term - The request term.IllegalArgumentException - if term is negativepublic VoteRequest.Builder withCandidate(int candidate)
candidate - The request candidate.IllegalArgumentException - if candidate is not positivepublic VoteRequest.Builder withLogIndex(long index)
index - The request last log index.IllegalArgumentException - if index is negativepublic VoteRequest.Builder withLogTerm(long term)
term - The request last log term.IllegalArgumentException - if term is negativepublic VoteRequest build()
build in class AbstractRequest.Builder<VoteRequest.Builder,VoteRequest>IllegalStateException - if candidate is not positive or if term, logIndex or logTerm are negativeCopyright © 2013–2015. All rights reserved.