Package io.atomix.raft.protocol
Class ConfigurationResponse.Builder<T extends ConfigurationResponse.Builder<T,U>,U extends ConfigurationResponse>
java.lang.Object
io.atomix.raft.protocol.AbstractRaftResponse.Builder<T,U>
io.atomix.raft.protocol.ConfigurationResponse.Builder<T,U>
- All Implemented Interfaces:
RaftResponse.Builder<T,,U> Builder<U>
- Direct Known Subclasses:
ReconfigureResponse.Builder
- Enclosing class:
ConfigurationResponse
public abstract static class ConfigurationResponse.Builder<T extends ConfigurationResponse.Builder<T,U>,U extends ConfigurationResponse>
extends AbstractRaftResponse.Builder<T,U>
Configuration response builder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected Collection<RaftMember> protected longprotected longFields inherited from class io.atomix.raft.protocol.AbstractRaftResponse.Builder
error, status -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvalidate()Validates the builder.withIndex(long index) Sets the response index.withMembers(Collection<RaftMember> members) Sets the response members.withTerm(long term) Sets the response term.withTime(long time) Sets the response time.Methods inherited from class io.atomix.raft.protocol.AbstractRaftResponse.Builder
toString, withError, withStatusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.atomix.raft.protocol.RaftResponse.Builder
withError, withError
-
Field Details
-
index
protected long index -
term
protected long term -
timestamp
protected long timestamp -
members
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withIndex
Sets the response index.- Parameters:
index- The response index.- Returns:
- The response builder.
- Throws:
IllegalArgumentException- ifindexis negative
-
withTerm
Sets the response term.- Parameters:
term- The response term.- Returns:
- The response builder.
- Throws:
IllegalArgumentException- iftermis negative
-
withTime
Sets the response time.- Parameters:
time- The response time.- Returns:
- The response builder.
- Throws:
IllegalArgumentException- iftimeis negative
-
withMembers
Sets the response members.- Parameters:
members- The response members.- Returns:
- The response builder.
- Throws:
NullPointerException- ifmembersis null
-
validate
protected void validate()Description copied from class:AbstractRaftResponse.BuilderValidates the builder.- Overrides:
validatein classAbstractRaftResponse.Builder<T extends ConfigurationResponse.Builder<T,U>, U extends ConfigurationResponse>
-