Interface ServletResponseEncoder<T>

Type Parameters:
T - The response type
All Known Implementing Classes:
AbstractFileEncoder, FileEncoder, StreamFileEncoder, SystemFileEncoder

@Indexed(ServletResponseEncoder.class) public interface ServletResponseEncoder<T>
An interface for custom encoding of the HTTP response.
Since:
1.0.0
Author:
graemerocher
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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

      Class<T> 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 change
      annotationMetadata - The annotation metadata declared on the method
      value - The value to encode
      Returns:
      A publisher that emits completes with the response once the value has been encoded