Class ResponseDecorator.DecoratedResponseBuilder<T>

java.lang.Object
se.fortnox.reactivewizard.jaxrs.response.ResponseDecorator.DecoratedResponseBuilder<T>
Enclosing class:
ResponseDecorator

public static class ResponseDecorator.DecoratedResponseBuilder<T> extends Object
  • Constructor Details

    • DecoratedResponseBuilder

      public DecoratedResponseBuilder(T response)
  • Method Details

    • withHeaders

      @Nonnull public ResponseDecorator.DecoratedResponseBuilder<T> withHeaders(@Nonnull Map<String,String> headers)
      Set the headers map that will be used. Replaces any currently set headers. The content of the map may be altered during the handling of a response.
      Parameters:
      headers - A map of header values.
      Returns:
      this
    • withHeader

      @Nonnull public ResponseDecorator.DecoratedResponseBuilder<T> withHeader(@Nonnull String name, @Nonnull String value)
      Appends a header to the current header collection.
      Parameters:
      name - the name of the header
      value - the value of the header
      Returns:
      this
    • withStatus

      @Nonnull public ResponseDecorator.DecoratedResponseBuilder<T> withStatus(@Nullable io.netty.handler.codec.http.HttpResponseStatus status)
      Set the status that will be returned. Calling this method will replace any currently set status.
      Parameters:
      status - The status object
      Returns:
      this
    • withStatus

      @Nonnull public ResponseDecorator.DecoratedResponseBuilder<T> withStatus(@Nonnull AtomicReference<io.netty.handler.codec.http.HttpResponseStatus> status)
      Set the status that will be returned. Calling this method will replace any currently set status. The content of the AtomicReference may be altered during the handling of a response.
      Parameters:
      status - An AtomicReference to the status object
      Returns:
      this
    • build

      @Nonnull public T build()
      Create the decorated response Observable.
      Returns:
      ObservableWithHeaders<T>