Package org.somda.sdc.dpws.http
Enum ContentType.ContentTypes
- java.lang.Object
-
- java.lang.Enum<ContentType.ContentTypes>
-
- org.somda.sdc.dpws.http.ContentType.ContentTypes
-
- All Implemented Interfaces:
Serializable,Comparable<ContentType.ContentTypes>
- Enclosing class:
- ContentType
public static enum ContentType.ContentTypes extends Enum<ContentType.ContentTypes>
Representation of all accepted content-types as well as their default charset, if it is given.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPLICATION_SOAP_XMLAPPLICATION_XMLTEXT_XML
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Optional<ContentType.ContentTypes>fromMime(String mime)Maps a mime-type to the respective ContentType.ContentTypes enum value.StringgetContentType()CharsetgetDefaultEncoding()static ContentType.ContentTypesvalueOf(String name)Returns the enum constant of this type with the specified name.static ContentType.ContentTypes[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TEXT_XML
public static final ContentType.ContentTypes TEXT_XML
-
APPLICATION_XML
public static final ContentType.ContentTypes APPLICATION_XML
-
APPLICATION_SOAP_XML
public static final ContentType.ContentTypes APPLICATION_SOAP_XML
-
-
Method Detail
-
values
public static ContentType.ContentTypes[] 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 (ContentType.ContentTypes c : ContentType.ContentTypes.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ContentType.ContentTypes 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 nameNullPointerException- if the argument is null
-
fromMime
public static Optional<ContentType.ContentTypes> fromMime(String mime)
Maps a mime-type to the respective ContentType.ContentTypes enum value.- Parameters:
mime- to map to content types value- Returns:
- enum value if present, empty Optional otherwise
-
getDefaultEncoding
public Charset getDefaultEncoding()
-
getContentType
public String getContentType()
-
-