public static class VoteRequest.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
VoteRequest |
build() |
VoteRequest.Builder |
withCandidate(MemberId candidate)
Sets the request leader.
|
VoteRequest.Builder |
withLastLogIndex(long logIndex)
Sets the request last log index.
|
VoteRequest.Builder |
withLastLogTerm(long logTerm)
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(MemberId candidate)
candidate - The request candidate.IllegalArgumentException - if candidate is not positivepublic VoteRequest.Builder withLastLogIndex(long logIndex)
logIndex - The request last log index.IllegalArgumentException - if index is negativepublic VoteRequest.Builder withLastLogTerm(long logTerm)
logTerm - The request last log term.IllegalArgumentException - if term is negativepublic VoteRequest build()
Copyright © 2013–2017. All rights reserved.