From b058d1e07a738e393cb17fd66a917d07395de764 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Mon, 9 May 2011 11:20:49 +0000 Subject: [PATCH] Made comparators public, as they are needed elsewhere. --- .../java/org/springframework/http/MediaType.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java index 8a49554871..af99c3c5f5 100644 --- a/org.springframework.web/src/main/java/org/springframework/http/MediaType.java +++ b/org.springframework.web/src/main/java/org/springframework/http/MediaType.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -586,7 +586,7 @@ public class MediaType implements Comparable { /** - * Parse the given, comma-seperated string into a list of {@link MediaType} objects. + * Parse the given, comma-separated string into a list of {@link MediaType} objects. *

This method can be used to parse an Accept or Content-Type header. * @param mediaTypes the string to parse * @return the list of media types @@ -684,7 +684,10 @@ public class MediaType implements Comparable { } - static final Comparator SPECIFICITY_COMPARATOR = new Comparator() { + /** + * Comparator used by {@link #sortBySpecificity(List)}. + */ + public static final Comparator SPECIFICITY_COMPARATOR = new Comparator() { public int compare(MediaType mediaType1, MediaType mediaType2) { if (mediaType1.isWildcardType() && !mediaType2.isWildcardType()) { // */* < audio/* @@ -724,7 +727,10 @@ public class MediaType implements Comparable { }; - static final Comparator QUALITY_VALUE_COMPARATOR = new Comparator() { + /** + * Comparator used by {@link #sortByQualityValue(List)}. + */ + public static final Comparator QUALITY_VALUE_COMPARATOR = new Comparator() { public int compare(MediaType mediaType1, MediaType mediaType2) { double quality1 = mediaType1.getQualityValue();