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, InstallResponse.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 Details

    • withStatus

      T withStatus(RaftResponse.Status status)
      Sets the response status.
      Parameters:
      status - The response status.
      Returns:
      The response builder.
      Throws:
      NullPointerException - if status is null
    • withError

      default T withError(RaftError.Type type)
      Sets the response error.
      Parameters:
      type - The response error type.
      Returns:
      The response builder.
      Throws:
      NullPointerException - if type is null
    • withError

      T withError(RaftError error)
      Sets the response error.
      Parameters:
      error - The response error.
      Returns:
      The response builder.
      Throws:
      NullPointerException - if error is null
    • withError

      default T withError(RaftError.Type type, String message)
      Sets the response error.
      Parameters:
      type - The response error type.
      message - The response error message.
      Returns:
      The response builder.
      Throws:
      NullPointerException - if type is null