Class ResponseDecorator.DecoratedResponseBuilder<T>
java.lang.Object
se.fortnox.reactivewizard.jaxrs.response.ResponseDecorator.DecoratedResponseBuilder<T>
- Enclosing class:
- ResponseDecorator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create the decorated response Observable.withHeader(String name, String value) Appends a header to the current header collection.withHeaders(Map<String, String> headers) Set the headers map that will be used.withStatus(io.netty.handler.codec.http.HttpResponseStatus status) Set the status that will be returned.withStatus(AtomicReference<io.netty.handler.codec.http.HttpResponseStatus> status) Set the status that will be returned.
-
Constructor Details
-
DecoratedResponseBuilder
-
-
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 headervalue- 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
Create the decorated response Observable.- Returns:
- ObservableWithHeaders<T>
-