Package io.micronaut.serde.support.util
Class JsonViewUtil
java.lang.Object
io.micronaut.serde.support.util.JsonViewUtil
Utilities for implementing JsonView support in mappers.
- Since:
- 2.12
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?>
extractView
(@Nullable SerdeConfiguration configuration, @NonNull io.micronaut.core.type.Argument<?> argument, Class<?> defaultValue) Extract a view annotation from an argument, if present.
-
Method Details
-
extractView
@Contract(pure=true, value="_, _, !null -> !null") public static Class<?> extractView(@Nullable @Nullable SerdeConfiguration configuration, @NonNull @NonNull io.micronaut.core.type.Argument<?> argument, Class<?> defaultValue) Extract a view annotation from an argument, if present.- Parameters:
configuration
- Configuration for checkingSerdeConfiguration.isJsonViewEnabled()
argument
- The argument to checkdefaultValue
- The fallback view- Returns:
- The extracted view, or
defaultValue
as a fallback
-