List of usage examples for org.springframework.http MediaType copyQualityValue
public MediaType copyQualityValue(MediaType mediaType)
From source file:org.craftercms.commons.rest.HttpMessageConvertingResponseWriter.java
/** * Return the more specific of the acceptable and the producible media types with the q-value of the former. *//*from w ww.j ava 2s .c o m*/ protected MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) <= 0 ? acceptType : produceType; }
From source file:org.beadle.framework.view.ReturnTypeViewResolver.java
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former./*from w ww . j a v a 2s. co m*/ */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType; }
From source file:org.springframework.boot.actuate.endpoint.mvc.EndpointHandlerAdapter.java
private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) <= 0 ? acceptType : produceType; }
From source file:org.springframework.web.reactive.result.HandlerResultHandlerSupport.java
private MediaType selectMoreSpecificMediaType(MediaType acceptable, MediaType producible) { producible = producible.copyQualityValue(acceptable); Comparator<MediaType> comparator = MediaType.SPECIFICITY_COMPARATOR; return (comparator.compare(acceptable, producible) <= 0 ? acceptable : producible); }