com.github.kristofa.test.http
Enum MediaType
java.lang.Object
java.lang.Enum<MediaType>
com.github.kristofa.test.http.MediaType
- All Implemented Interfaces:
- Serializable, Comparable<MediaType>
public enum MediaType
- extends Enum<MediaType>
The media type is the value of Content-Type http message header and is defined of 2 or more parts. A main type, sub type
and zero or more optional sub types. For example, subtypes of application/json have an optional charset parameter that can
be included to indicate the character encoding eg: application/json; charset=UTF-8.
- Author:
- kristof
|
Method Summary |
String |
getValue()
Get value of MediaType. |
static MediaType |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static MediaType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
APPLICATION_JSON_UTF8
public static final MediaType APPLICATION_JSON_UTF8
values
public static MediaType[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (MediaType c : MediaType.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static MediaType valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is null
getValue
public String getValue()
- Get value of MediaType.
- Returns:
- String value of MediaType.
Copyright © 2014. All Rights Reserved.