public static class PollRequest.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
PollRequest |
build() |
PollRequest.Builder |
withCandidate(MemberId candidate)
Sets the request leader.
|
PollRequest.Builder |
withLastLogIndex(long logIndex)
Sets the request last log index.
|
PollRequest.Builder |
withLastLogTerm(long logTerm)
Sets the request last log term.
|
PollRequest.Builder |
withTerm(long term)
Sets the request term.
|
public PollRequest.Builder withTerm(long term)
term - The request term.IllegalArgumentException - if term is negativepublic PollRequest.Builder withCandidate(MemberId candidate)
candidate - The request candidate.IllegalArgumentException - if candidate is not positivepublic PollRequest.Builder withLastLogIndex(long logIndex)
logIndex - The request last log index.IllegalArgumentException - if index is negativepublic PollRequest.Builder withLastLogTerm(long logTerm)
logTerm - The request last log term.IllegalArgumentException - if term is negativepublic PollRequest build()
IllegalStateException - if candidate is not positive or if term, lastLogIndex or lastLogTerm are negativeCopyright © 2013–2017. All rights reserved.