public final class ContentType extends Object
Constructor and Description |
---|
ContentType(String contentType)
Creates a new content type from the argument.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Returns true only if the other object is another instance of ContentType, and has the same baseType, subType and
set of parameters.
|
String |
getBaseType() |
String |
getCharset() |
String |
getMimeType() |
String |
getParameter(String key) |
List<String> |
getParameterNames() |
String |
getSubType() |
boolean |
hasParameters() |
String |
toString() |
ContentType |
withCharset(String charset) |
ContentType |
withParameter(String key,
String value)
Returns a new content type with the indicated parameter.
|
public ContentType(String contentType)
contentType
- the content type that needs to be representedpublic boolean equals(Object o)
public String getBaseType()
public String getSubType()
public String getMimeType()
public List<String> getParameterNames()
public String getCharset()
public String getParameter(String key)
key
- the name of the content type parameterpublic ContentType withParameter(String key, String value)
public ContentType withCharset(String charset)
public boolean hasParameters()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.