Class WebClientServiceResponse.BuilderBase<BUILDER extends WebClientServiceResponse.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebClientServiceResponse>

java.lang.Object
io.helidon.webclient.api.WebClientServiceResponse.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
WebClientServiceResponse.Builder
Enclosing interface:
WebClientServiceResponse

public abstract static class WebClientServiceResponse.BuilderBase<BUILDER extends WebClientServiceResponse.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebClientServiceResponse> extends Object implements Prototype.Builder<BUILDER,PROTOTYPE>
Fluent API builder base for WebClientServiceResponse.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(WebClientServiceResponse prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(WebClientServiceResponse.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • headers

      public BUILDER headers(ClientResponseHeaders headers)
      Received response headers.
      Parameters:
      headers - immutable response headers
      Returns:
      updated builder instance
      See Also:
    • trailers

      public BUILDER trailers(CompletableFuture<ClientResponseTrailers> trailers)
      Received response trailer headers.
      Parameters:
      trailers - immutable response trailer headers
      Returns:
      updated builder instance
      See Also:
    • status

      public BUILDER status(Status status)
      Status of the response.
      Parameters:
      status - response status
      Returns:
      updated builder instance
      See Also:
    • clearInputStream

      public BUILDER clearInputStream()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • inputStream

      public BUILDER inputStream(InputStream inputStream)
      Input stream to get data of the entity. This allows decorating the entity (such as decryption). The status, headers are always already read, and the input stream will not provide transfer encoded bytes (e.g. the bytes in the input stream are the entity bytes, regardless of how it is encoded over HTTP).
      Parameters:
      inputStream - entity input stream, or empty, if there is no entity
      Returns:
      updated builder instance
      See Also:
    • connection

      public BUILDER connection(ReleasableResource connection)
      Client connection/stream that was used to handle this request. This resource will be closed/released once the entity is fully read, depending on keep alive configuration.
      Parameters:
      connection - connection resource
      Returns:
      updated builder instance
      See Also:
    • whenComplete

      public BUILDER whenComplete(CompletableFuture<WebClientServiceResponse> whenComplete)
      Completable future to be completed by the client response when the entity is fully read.
      Parameters:
      whenComplete - completable future to be finished by the client response
      Returns:
      updated builder instance
      See Also:
    • serviceRequest

      public BUILDER serviceRequest(WebClientServiceRequest serviceRequest)
      The service request used to invoke the final call.
      Parameters:
      serviceRequest - service request
      Returns:
      updated builder instance
      See Also:
    • headers

      public Optional<ClientResponseHeaders> headers()
      Received response headers.
      Returns:
      the headers
    • trailers

      Received response trailer headers.
      Returns:
      the trailers
    • status

      public Optional<Status> status()
      Status of the response.
      Returns:
      the status
    • inputStream

      public Optional<InputStream> inputStream()
      Input stream to get data of the entity. This allows decorating the entity (such as decryption). The status, headers are always already read, and the input stream will not provide transfer encoded bytes (e.g. the bytes in the input stream are the entity bytes, regardless of how it is encoded over HTTP).
      Returns:
      the input stream
    • connection

      public Optional<ReleasableResource> connection()
      Client connection/stream that was used to handle this request. This resource will be closed/released once the entity is fully read, depending on keep alive configuration.
      Returns:
      the connection
    • whenComplete

      Completable future to be completed by the client response when the entity is fully read.
      Returns:
      the when complete
    • serviceRequest

      public Optional<WebClientServiceRequest> serviceRequest()
      The service request used to invoke the final call.
      Returns:
      the service request
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.