Java Code Examples for org.springframework.http.MediaType#copyQualityValue()
The following examples show how to use
org.springframework.http.MediaType#copyQualityValue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpMessageConverterResolver.java From spring-cloud-alibaba with Apache License 2.0 | 5 votes |
/** * Return the more specific of the acceptable and the producible media types with the * q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { MediaType produceTypeToUse = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse); }
Example 2
Source File: HandlerResultHandlerSupport.java From spring-analysis-note with MIT License | 4 votes |
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); }
Example 3
Source File: ContentNegotiatingViewResolver.java From spring-analysis-note with MIT License | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType); }
Example 4
Source File: AbstractMessageConverterMethodProcessor.java From spring-analysis-note with MIT License | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { MediaType produceTypeToUse = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse); }
Example 5
Source File: HandlerResultHandlerSupport.java From java-technology-stack with MIT License | 4 votes |
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); }
Example 6
Source File: ContentNegotiatingViewResolver.java From java-technology-stack with MIT License | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType); }
Example 7
Source File: AbstractMessageConverterMethodProcessor.java From java-technology-stack with MIT License | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { MediaType produceTypeToUse = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse); }
Example 8
Source File: ContentNegotiatingViewResolver.java From lams with GNU General Public License v2.0 | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType); }
Example 9
Source File: AbstractMessageConverterMethodProcessor.java From lams with GNU General Public License v2.0 | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { MediaType produceTypeToUse = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse); }
Example 10
Source File: ContentNegotiatingViewResolver.java From spring4-understanding with Apache License 2.0 | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { produceType = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceType) < 0 ? acceptType : produceType); }
Example 11
Source File: AbstractMessageConverterMethodProcessor.java From spring4-understanding with Apache License 2.0 | 4 votes |
/** * Return the more specific of the acceptable and the producible media types * with the q-value of the former. */ private MediaType getMostSpecificMediaType(MediaType acceptType, MediaType produceType) { MediaType produceTypeToUse = produceType.copyQualityValue(acceptType); return (MediaType.SPECIFICITY_COMPARATOR.compare(acceptType, produceTypeToUse) <= 0 ? acceptType : produceTypeToUse); }