Class ApiResponse.Builder<B extends ApiResponse.Builder<B,T>,T extends ApiResponse>

java.lang.Object
io.helidon.integrations.common.rest.ApiResponse.Builder<B,T>
Type Parameters:
B - type of the builder
T - type of api response
All Implemented Interfaces:
Builder<B,T>, Supplier<T>
Direct Known Subclasses:
ApiEntityResponse.Builder, ApiOptionalResponse.BuilderBase
Enclosing class:
ApiResponse

public abstract static class ApiResponse.Builder<B extends ApiResponse.Builder<B,T>,T extends ApiResponse> extends Object implements Builder<B,T>
Abstract fluent API builder to build subclasses of ApiResponse.
  • Constructor Details

    • Builder

      protected Builder()
      New builder.
  • Method Details

    • headers

      public B headers(Headers headers)
      Configure the HTTP headers returned by the API call.
      Parameters:
      headers - headers
      Returns:
      updated builder
    • status

      public B status(Http.ResponseStatus status)
      Response status returned by the API call.
      Parameters:
      status - HTTP status
      Returns:
      updated builder
    • requestId

      public B requestId(String requestId)
      Request ID used when dispatching this request.
      Parameters:
      requestId - request id
      Returns:
      updated builder
    • headers

      public Headers headers()
      Received HTTP headers.
      Returns:
      headers
    • status

      public Http.ResponseStatus status()
      Received HTTP status.
      Returns:
      status
    • requestId

      public String requestId()
      Request ID used to invoke the request. This may be generated by RestApi
      Returns:
      request id
    • me

      protected B me()
      Can be returned by subclasses that can be subclassed again.
      Returns:
      this instance as a subclass type