Package io.micronaut.servlet.http
Interface ServletResponseEncoder<T>
- Type Parameters:
T- The response type
- All Known Implementing Classes:
AbstractFileEncoder,FileEncoder,StreamFileEncoder,SystemFileEncoder
An interface for custom encoding of the HTTP response.
- Since:
- 1.0.0
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>>encode(@NonNull ServletExchange<?, ?> exchange, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, T value) Encode the given value.
-
Method Details
-
getResponseType
- Returns:
- The response type.
-
encode
org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> encode(@NonNull @NonNull ServletExchange<?, ?> exchange, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull T value) Encode the given value.- Parameters:
exchange- The changeannotationMetadata- The annotation metadata declared on the methodvalue- The value to encode- Returns:
- A publisher that emits completes with the response once the value has been encoded
-