Polishing
This commit is contained in:
@@ -49,7 +49,6 @@ import org.springframework.util.StringUtils;
|
|||||||
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">
|
* @see <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">
|
||||||
* HTTP 1.1: Semantics and Content, section 3.1.1.1</a>
|
* HTTP 1.1: Semantics and Content, section 3.1.1.1</a>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class MediaType extends MimeType implements Serializable {
|
public class MediaType extends MimeType implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2069937152339670231L;
|
private static final long serialVersionUID = 2069937152339670231L;
|
||||||
@@ -370,6 +369,7 @@ public class MediaType extends MimeType implements Serializable {
|
|||||||
|
|
||||||
private static final String PARAM_QUALITY_FACTOR = "q";
|
private static final String PARAM_QUALITY_FACTOR = "q";
|
||||||
|
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Not using "valueOf' to avoid static init cost
|
// Not using "valueOf' to avoid static init cost
|
||||||
ALL = new MediaType("*", "*");
|
ALL = new MediaType("*", "*");
|
||||||
@@ -400,6 +400,7 @@ public class MediaType extends MimeType implements Serializable {
|
|||||||
TEXT_XML = new MediaType("text", "xml");
|
TEXT_XML = new MediaType("text", "xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new {@code MediaType} for the given primary type.
|
* Create a new {@code MediaType} for the given primary type.
|
||||||
* <p>The {@linkplain #getSubtype() subtype} is set to "*", parameters empty.
|
* <p>The {@linkplain #getSubtype() subtype} is set to "*", parameters empty.
|
||||||
@@ -483,11 +484,11 @@ public class MediaType extends MimeType implements Serializable {
|
|||||||
* checks on parameters are performed.
|
* checks on parameters are performed.
|
||||||
* @param mimeType the MIME type
|
* @param mimeType the MIME type
|
||||||
* @throws IllegalArgumentException if any of the parameters contain illegal characters
|
* @throws IllegalArgumentException if any of the parameters contain illegal characters
|
||||||
* @since 5.3.0
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
public MediaType(MimeType mimeType) {
|
public MediaType(MimeType mimeType) {
|
||||||
super(mimeType);
|
super(mimeType);
|
||||||
this.getParameters().forEach(this::checkParameters);
|
getParameters().forEach(this::checkParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user