Package io.micronaut.http.netty
Interface NettyHttpResponseBuilder
- All Known Implementing Classes:
FullNettyClientHttpResponse
,NettyMutableHttpResponse
public interface NettyHttpResponseBuilder
Common interface for client and server to implement to construct the Netty versions of the response objects.
- Since:
- 2.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isStream()
@NonNull io.netty.handler.codec.http.FullHttpResponse
Converts this object to a full http response.static @NonNull io.netty.handler.codec.http.FullHttpResponse
toFullHttpResponse
(HttpResponse<?> response, @NonNull io.netty.buffer.ByteBuf byteBuf) Convert the given response to a full http response.default @NonNull io.netty.handler.codec.http.HttpResponse
Converts this object to the most appropriate http response type.static @NonNull io.netty.handler.codec.http.HttpResponse
toHttpResponse
(HttpResponse<?> response) Convert the given response to a full http response.default @NonNull StreamedHttpResponse
Converts this object to a streamed http response.static @NonNull StreamedHttpResponse
toStreamResponse
(HttpResponse<?> response) Convert the given response to a full http response.
-
Method Details
-
toFullHttpResponse
Converts this object to a full http response.- Returns:
- a full http response
-
toStreamHttpResponse
Converts this object to a streamed http response.- Returns:
- The streamed response
-
toHttpResponse
Converts this object to the most appropriate http response type.- Returns:
- The http response
-
isStream
boolean isStream()- Returns:
- Is the response a stream.
-
toHttpResponse
@NonNull static @NonNull io.netty.handler.codec.http.HttpResponse toHttpResponse(@NonNull HttpResponse<?> response) Convert the given response to a full http response.- Parameters:
response
- The response- Returns:
- The full response.
-
toFullHttpResponse
@NonNull static @NonNull io.netty.handler.codec.http.FullHttpResponse toFullHttpResponse(@NonNull HttpResponse<?> response, @NonNull @NonNull io.netty.buffer.ByteBuf byteBuf) Convert the given response to a full http response.- Parameters:
response
- The responsebyteBuf
- The byteBuf- Returns:
- The full response.
- Since:
- 4.3.0
-
toStreamResponse
Convert the given response to a full http response.- Parameters:
response
- The response- Returns:
- The full response.
-