Package io.atomix.raft.protocol
Interface RaftResponse.Builder<T extends RaftResponse.Builder<T,U>,U extends RaftResponse>
- Type Parameters:
T- The builder type.U- The response type.
- All Superinterfaces:
Builder<U>
- All Known Implementing Classes:
AbstractRaftResponse.Builder,AppendResponse.Builder,ConfigurationResponse.Builder,ConfigureResponse.Builder,ForceConfigureResponse.Builder,InstallResponse.Builder,JoinResponse.Builder,LeaveResponse.Builder,PollResponse.Builder,ReconfigureResponse.Builder,TransferResponse.Builder,VoteResponse.Builder
- Enclosing interface:
RaftResponse
public static interface RaftResponse.Builder<T extends RaftResponse.Builder<T,U>,U extends RaftResponse>
extends Builder<U>
Response builder.
-
Method Summary
Modifier and TypeMethodDescriptionSets the response error.default TwithError(RaftError.Type type) Sets the response error.default TwithError(RaftError.Type type, String message) Sets the response error.withStatus(RaftResponse.Status status) Sets the response status.
-
Method Details
-
withStatus
Sets the response status.- Parameters:
status- The response status.- Returns:
- The response builder.
- Throws:
NullPointerException- ifstatusis null
-
withError
Sets the response error.- Parameters:
type- The response error type.- Returns:
- The response builder.
- Throws:
NullPointerException- iftypeis null
-
withError
Sets the response error.- Parameters:
error- The response error.- Returns:
- The response builder.
- Throws:
NullPointerException- iferroris null
-
withError
Sets the response error.- Parameters:
type- The response error type.message- The response error message.- Returns:
- The response builder.
- Throws:
NullPointerException- iftypeis null
-