public enum ContentType extends Enum<ContentType>
| Enum Constant and Description |
|---|
JS
represents javascript content.
|
JSON
represents json content.
|
TEXT
represents plain text content.
|
XML
represents xml content.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
config(Config config)
configures the internal map of handled content types (See
RestFixtureConfig). |
static ContentType |
parse(String contentTypeString)
parses a string to a content type.
|
static void |
resetDefaultMapping()
resets the internal cache to default values.
|
List<String> |
toMime() |
static ContentType |
typeFor(String t) |
static ContentType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ContentType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ContentType XML
public static final ContentType JSON
public static final ContentType TEXT
public static final ContentType JS
public static ContentType[] values()
for (ContentType c : ContentType.values()) System.out.println(c);
public static ContentType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static ContentType typeFor(String t)
t - the content type stringpublic static void config(Config config)
RestFixtureConfig). It reads two properties:
restfixture.content.default.charset to determine the default
charset for that content type, in cases when the content type header of
the request/response isn't specifying the charset. If this config
parameter is not set, then the default value is
Charset.defaultCharset().
restfixture.content.handlers.map to override the default map.
config - the configpublic static void resetDefaultMapping()
public static ContentType parse(String contentTypeString)
contentTypeString - the content typeContentType.Copyright © 2017 smartrics. All rights reserved.