@Header(value="Content-Type") @BeanIgnore public class ContentType extends BasicMediaTypeHeader
The MIME type of this content.
Content-Type: text/html; charset=utf-8
Content-Type = "Content-Type" ":" media-type
Media types are defined in section 3.7. An example of the field is...
Content-Type: text/html; charset=ISO-8859-4
Constructor and Description |
---|
ContentType(Object value)
Constructor.
|
ContentType(String value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static ContentType |
of(MediaType value)
Returns a parsed and cached
|
static ContentType |
of(Object value)
Convenience creator.
|
static ContentType |
of(String value)
Returns a parsed and cached
|
static ContentType |
of(Supplier<?> value)
Convenience creator using supplier.
|
asMediaType, getParameter, getParameters, getSubType, getSubTypes, getType, getValue, hasSubType, isMetaSubtype, match, match, of, of
assertString
assertName, assertValue, canCast, cast, eqIC, equals, getElements, getName, getRawValue, hashCode, isSupplier, of, ofPair, toString, unwrap
public ContentType(Object value)
value
- The value for this header.public ContentType(String value)
value
- The value for this header.public static ContentType of(String value)
value
- The public static ContentType of(MediaType value)
value
- The public static ContentType of(Object value)
value
- The header value.
String
- Converted using MediaType.of(String)
.
MediaType
.
AcceptEncoding
object.public static ContentType of(Supplier<?> value)
Header value is re-evaluated on each call to BasicMediaTypeHeader.getValue()
.
value
- The header value supplier.
String
- Converted using MediaType.of(String)
.
MediaType
.
AcceptEncoding
object.Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.