Skip to content

Commit c543368

Browse files
committed
Polishing
1 parent 06fef1e commit c543368

File tree

3 files changed

+404
-394
lines changed

3 files changed

+404
-394
lines changed

spring-core/src/main/java/org/springframework/util/MimeType.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
import org.springframework.lang.Nullable;
3232

3333
/**
34-
* Represents a MIME Type, as originally defined in RFC 2046 and subsequently used in
35-
* other Internet protocols including HTTP.
34+
* Represents a MIME Type, as originally defined in RFC 2046 and subsequently
35+
* used in other Internet protocols including HTTP.
3636
*
3737
* <p>This class, however, does not contain support for the q-parameters used
38-
* in HTTP content negotiation. Those can be found in the sub-class
38+
* in HTTP content negotiation. Those can be found in the subclass
3939
* {@code org.springframework.http.MediaType} in the {@code spring-web} module.
4040
*
4141
* <p>Consists of a {@linkplain #getType() type} and a {@linkplain #getSubtype() subtype}.
42-
* Also has functionality to parse media types from a string using
42+
* Also has functionality to parse MIME Type values from a {@code String} using
4343
* {@link #valueOf(String)}. For more parsing options see {@link MimeTypeUtils}.
4444
*
4545
* @author Arjen Poutsma
@@ -139,7 +139,7 @@ public MimeType(String type, String subtype, Charset charset) {
139139
/**
140140
* Copy-constructor that copies the type, subtype, parameters of the given {@code MimeType},
141141
* and allows to set the specified character set.
142-
* @param other the other media type
142+
* @param other the other MimeType
143143
* @param charset the character set
144144
* @throws IllegalArgumentException if any of the parameters contains illegal characters
145145
* @since 4.3
@@ -151,8 +151,8 @@ public MimeType(MimeType other, Charset charset) {
151151
/**
152152
* Copy-constructor that copies the type and subtype of the given {@code MimeType},
153153
* and allows for different parameter.
154-
* @param other the other media type
155-
* @param parameters the parameters, may be {@code null}
154+
* @param other the other MimeType
155+
* @param parameters the parameters (may be {@code null})
156156
* @throws IllegalArgumentException if any of the parameters contains illegal characters
157157
*/
158158
public MimeType(MimeType other, @Nullable Map<String, String> parameters) {
@@ -163,7 +163,7 @@ public MimeType(MimeType other, @Nullable Map<String, String> parameters) {
163163
* Create a new {@code MimeType} for the given type, subtype, and parameters.
164164
* @param type the primary type
165165
* @param subtype the subtype
166-
* @param parameters the parameters, may be {@code null}
166+
* @param parameters the parameters (may be {@code null})
167167
* @throws IllegalArgumentException if any of the parameters contains illegal characters
168168
*/
169169
public MimeType(String type, String subtype, @Nullable Map<String, String> parameters) {
@@ -246,9 +246,9 @@ public boolean isWildcardSubtype() {
246246
}
247247

248248
/**
249-
* Indicates whether this media type is concrete, i.e. whether neither the type
249+
* Indicates whether this MIME Type is concrete, i.e. whether neither the type
250250
* nor the subtype is a wildcard character <code>&#42;</code>.
251-
* @return whether this media type is concrete
251+
* @return whether this MIME Type is concrete
252252
*/
253253
public boolean isConcrete() {
254254
return !isWildcardType() && !isWildcardSubtype();
@@ -298,12 +298,12 @@ public Map<String, String> getParameters() {
298298
}
299299

300300
/**
301-
* Indicate whether this {@code MediaType} includes the given media type.
301+
* Indicate whether this MIME Type includes the given MIME Type.
302302
* <p>For instance, {@code text/*} includes {@code text/plain} and {@code text/html},
303-
* and {@code application/*+xml} includes {@code application/soap+xml}, etc. This
304-
* method is <b>not</b> symmetric.
305-
* @param other the reference media type with which to compare
306-
* @return {@code true} if this media type includes the given media type;
303+
* and {@code application/*+xml} includes {@code application/soap+xml}, etc.
304+
* This method is <b>not</b> symmetric.
305+
* @param other the reference MIME Type with which to compare
306+
* @return {@code true} if this MIME Type includes the given MIME Type;
307307
* {@code false} otherwise
308308
*/
309309
public boolean includes(@Nullable MimeType other) {
@@ -342,12 +342,12 @@ else if (getType().equals(other.getType())) {
342342
}
343343

344344
/**
345-
* Indicate whether this {@code MediaType} is compatible with the given media type.
345+
* Indicate whether this MIME Type is compatible with the given MIME Type.
346346
* <p>For instance, {@code text/*} is compatible with {@code text/plain},
347347
* {@code text/html}, and vice versa. In effect, this method is similar to
348348
* {@link #includes}, except that it <b>is</b> symmetric.
349-
* @param other the reference media type with which to compare
350-
* @return {@code true} if this media type is compatible with the given media type;
349+
* @param other the reference MIME Type with which to compare
350+
* @return {@code true} if this MIME Type is compatible with the given MIME Type;
351351
* {@code false} otherwise
352352
*/
353353
public boolean isCompatibleWith(@Nullable MimeType other) {
@@ -458,8 +458,8 @@ private void appendTo(Map<String, String> map, StringBuilder builder) {
458458
}
459459

460460
/**
461-
* Compares this {@code MediaType} to another alphabetically.
462-
* @param other media type to compare to
461+
* Compares this MIME Type to another alphabetically.
462+
* @param other the MIME Type to compare to
463463
* @see MimeTypeUtils#sortBySpecificity(List)
464464
*/
465465
@Override

0 commit comments

Comments
 (0)