Package io.micronaut.views.http
Interface ResponseBodySwapper<B>
- Type Parameters:
B- The response body
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Implementing Classes:
CompositeResponseBodySwapper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface ResponseBodySwapper<B>
extends io.micronaut.core.order.Ordered
A functional interface to swap the response's body with a new one.
- Since:
- 6.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescription@NonNull Optional<ResponseBodySwap<B>> swap(@NonNull io.micronaut.http.HttpRequest<?> request, @Nullable io.micronaut.http.HttpResponse<?> response) Returns a new response body to swap the Response body with or an empty optional.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
swap
@NonNull Optional<ResponseBodySwap<B>> swap(@NonNull io.micronaut.http.HttpRequest<?> request, @Nullable io.micronaut.http.HttpResponse<?> response) Returns a new response body to swap the Response body with or an empty optional.- Parameters:
request- The requestresponse- The response- Returns:
- A new response body or an empty optional
-