Skip to content

Commit

Permalink
Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
poutsma committed May 12, 2011
1 parent 580f35f commit 8190b4f
Showing 1 changed file with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public class MediaType implements Comparable<MediaType> {


/**
* Create a new {@link MediaType} for the given primary type.
* Create a new {@code MediaType} for the given primary type.
* <p>The {@linkplain #getSubtype() subtype} is set to <code>&#42;</code>, parameters empty.
* @param type the primary type
* @throws IllegalArgumentException if any of the parameters contain illegal characters
Expand All @@ -197,7 +197,7 @@ public MediaType(String type) {
}

/**
* Create a new {@link MediaType} for the given primary type and subtype.
* Create a new {@code MediaType} for the given primary type and subtype.
* <p>The parameters are empty.
* @param type the primary type
* @param subtype the subtype
Expand All @@ -208,7 +208,7 @@ public MediaType(String type, String subtype) {
}

/**
* Create a new {@link MediaType} for the given type, subtype, and character set.
* Create a new {@code MediaType} for the given type, subtype, and character set.
* @param type the primary type
* @param subtype the subtype
* @param charSet the character set
Expand All @@ -219,7 +219,7 @@ public MediaType(String type, String subtype, Charset charSet) {
}

/**
* Create a new {@link MediaType} for the given type, subtype, and quality value.
* Create a new {@code MediaType} for the given type, subtype, and quality value.
*
* @param type the primary type
* @param subtype the subtype
Expand All @@ -231,7 +231,7 @@ public MediaType(String type, String subtype, double qualityValue) {
}

/**
* Copy-constructor that copies the type and subtype of the given {@link MediaType},
* Copy-constructor that copies the type and subtype of the given {@code MediaType},
* and allows for different parameter.
* @param other the other media type
* @param parameters the parameters, may be <code>null</code>
Expand All @@ -242,7 +242,7 @@ public MediaType(MediaType other, Map<String, String> parameters) {
}

/**
* Create a new {@link MediaType} for the given type, subtype, and parameters.
* Create a new {@code MediaType} for the given type, subtype, and parameters.
* @param type the primary type
* @param subtype the subtype
* @param parameters the parameters, may be <code>null</code>
Expand Down Expand Up @@ -372,9 +372,9 @@ public String getParameter(String name) {
}

/**
* Indicate whether this {@link MediaType} includes the given media type.
* <p>For instance, {@code text/*} includes {@code text/plain}, {@code text/html}, and {@code application/*+xml}
* includes {@code application/soap+xml}, etc. This method is non-symmetic.
* Indicate whether this {@code MediaType} includes the given media type.
* <p>For instance, {@code text/*} includes {@code text/plain} and {@code text/html}, and {@code application/*+xml}
* includes {@code application/soap+xml}, etc. This method is <b>not</b> symmetric.
* @param other the reference media type with which to compare
* @return <code>true</code> if this media type includes the given media type; <code>false</code> otherwise
*/
Expand Down Expand Up @@ -407,9 +407,9 @@ else if (this.type.equals(other.type)) {
}

/**
* Indicate whether this {@link MediaType} is compatible with the given media type.
* Indicate whether this {@code MediaType} is compatible with the given media type.
* <p>For instance, {@code text/*} is compatible with {@code text/plain}, {@code text/html}, and vice versa.
* In effect, this method is similar to {@link #includes(MediaType)}, except that it's symmetric.
* In effect, this method is similar to {@link #includes(MediaType)}, except that it <b>is</b> symmetric.
* @param other the reference media type with which to compare
* @return <code>true</code> if this media type is compatible with the given media type; <code>false</code> otherwise
*/
Expand Down Expand Up @@ -444,7 +444,7 @@ else if (this.type.equals(other.type)) {
}

/**
* Compares this {@link MediaType} to another alphabetically.
* Compares this {@code MediaType} to another alphabetically.
* @param other media type to compare to
* @see #sortBySpecificity(List)
*/
Expand Down Expand Up @@ -533,7 +533,7 @@ private void appendTo(Map<String, String> map, StringBuilder builder) {


/**
* Parse the given String value into a {@link MediaType} object,
* Parse the given String value into a {@code MediaType} object,
* with this method name following the 'valueOf' naming convention
* (as supported by {@link org.springframework.core.convert.ConversionService}.
* @see #parseMediaType(String)
Expand All @@ -543,7 +543,7 @@ public static MediaType valueOf(String value) {
}

/**
* Parse the given String into a single {@link MediaType}.
* Parse the given String into a single {@code MediaType}.
* @param mediaType the string to parse
* @return the media type
* @throws IllegalArgumentException if the string cannot be parsed
Expand Down Expand Up @@ -586,7 +586,7 @@ public static MediaType parseMediaType(String mediaType) {


/**
* Parse the given, comma-separated string into a list of {@link MediaType} objects.
* Parse the given, comma-separated string into a list of {@code MediaType} objects.
* <p>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
Expand All @@ -605,7 +605,7 @@ public static List<MediaType> parseMediaTypes(String mediaTypes) {
}

/**
* Return a string representation of the given list of {@link MediaType} objects.
* Return a string representation of the given list of {@code MediaType} objects.
* <p>This method can be used to for an {@code Accept} or {@code Content-Type} header.
* @param mediaTypes the string to parse
* @return the list of media types
Expand All @@ -624,7 +624,7 @@ public static String toString(Collection<MediaType> mediaTypes) {
}

/**
* Sorts the given list of {@link MediaType} objects by specificity.
* Sorts the given list of {@code MediaType} objects by specificity.
* <p>Given two media types:
* <ol>
* <li>if either media type has a {@linkplain #isWildcardType() wildcard type}, then the media type without the
Expand Down Expand Up @@ -657,7 +657,7 @@ public static void sortBySpecificity(List<MediaType> mediaTypes) {
}

/**
* Sorts the given list of {@link MediaType} objects by quality value.
* Sorts the given list of {@code MediaType} objects by quality value.
* <p>Given two media types:
* <ol>
* <li>if the two media types have different {@linkplain #getQualityValue() quality value}, then the media type
Expand Down

0 comments on commit 8190b4f

Please sign in to comment.