Class ValidatorMediaTypeUtil

java.lang.Object
io.quarkus.hibernate.validator.runtime.jaxrs.ValidatorMediaTypeUtil

public final class ValidatorMediaTypeUtil extends Object
Utility class to deal with MediaTypes in JAX-RS endpoints.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final List<jakarta.ws.rs.core.MediaType>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static jakarta.ws.rs.core.MediaType
    getAcceptMediaType(List<jakarta.ws.rs.core.MediaType> mediaTypesFromRequest, List<jakarta.ws.rs.core.MediaType> mediaTypesFromProducesAnnotation)
    Look up the right media type taking into account the HTTP request and the media types defined in the `@Produces` annotation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SUPPORTED_MEDIA_TYPES

      static final List<jakarta.ws.rs.core.MediaType> SUPPORTED_MEDIA_TYPES
  • Method Details

    • getAcceptMediaType

      public static jakarta.ws.rs.core.MediaType getAcceptMediaType(List<jakarta.ws.rs.core.MediaType> mediaTypesFromRequest, List<jakarta.ws.rs.core.MediaType> mediaTypesFromProducesAnnotation)
      Look up the right media type taking into account the HTTP request and the media types defined in the `@Produces` annotation.
      Parameters:
      mediaTypesFromRequest - list of media types in the HTTP request.
      mediaTypesFromProducesAnnotation - list of media types set in the `@Produces` annotation.
      Returns:
      one supported media type from either the HTTP request or the annotation.