public class ContentType extends java.lang.Object
Constructor and Description |
---|
ContentType()
Creates a new empty content type
|
ContentType(java.lang.String contentType)
Creates a new content type from the argument.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns true only if the other object is another instance of ContentType, and has the ssame
baseType, subType and set of parameters.
|
java.lang.String |
getBaseType() |
java.lang.String |
getMimeType() |
java.lang.String |
getParameter(java.lang.String key) |
java.lang.String[] |
getParameterNames() |
java.lang.String |
getSubType() |
void |
parse(java.lang.String contentType)
Parses the argument and configures the content type accordingly.
|
void |
setBaseType(java.lang.String baseType) |
void |
setParameter(java.lang.String key,
java.lang.String value) |
void |
setSubType(java.lang.String subType) |
java.lang.String |
toString() |
java.lang.String |
unparse() |
public ContentType()
public ContentType(java.lang.String contentType)
contentType
- the content type that needs to be representedpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String getBaseType()
public void setBaseType(java.lang.String baseType)
baseType
- public java.lang.String getSubType()
public void setSubType(java.lang.String subType)
subType
- public java.lang.String getMimeType()
public java.lang.String[] getParameterNames()
public java.lang.String getParameter(java.lang.String key)
key
- the name of the content type parameterpublic void setParameter(java.lang.String key, java.lang.String value)
key
- the name of the content type parametervalue
- the value of the content type parameterpublic void parse(java.lang.String contentType)
contentType
- the content type that needs to be representedpublic java.lang.String unparse()
public java.lang.String toString()
toString
in class java.lang.Object