Class JsonViewUtil

java.lang.Object
io.micronaut.serde.support.util.JsonViewUtil

@Internal public final class JsonViewUtil extends Object
Utilities for implementing JsonView support in mappers.
Since:
2.12
Author:
Jonas Konrad
  • 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 checking SerdeConfiguration.isJsonViewEnabled()
      argument - The argument to check
      defaultValue - The fallback view
      Returns:
      The extracted view, or defaultValue as a fallback