public final class ContentType extends java.lang.Object
Constructor and Description |
---|
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 same baseType, subType and
set of parameters.
|
java.lang.String |
getBaseType() |
java.lang.String |
getCharset() |
java.lang.String |
getMimeType() |
java.lang.String |
getParameter(java.lang.String key) |
java.util.List<java.lang.String> |
getParameterNames() |
java.lang.String |
getSubType() |
boolean |
hasParameters() |
java.lang.String |
toString() |
ContentType |
withCharset(java.lang.String charset) |
ContentType |
withParameter(java.lang.String key,
java.lang.String value)
Returns a new content type with the indicated parameter.
|
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 java.lang.String getSubType()
public java.lang.String getMimeType()
public java.util.List<java.lang.String> getParameterNames()
public java.lang.String getCharset()
public java.lang.String getParameter(java.lang.String key)
key
- the name of the content type parameterpublic ContentType withParameter(java.lang.String key, java.lang.String value)
public ContentType withCharset(java.lang.String charset)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean hasParameters()
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.