Package com.amazonaws.util.json
Enum Jackson
- java.lang.Object
-
- java.lang.Enum<Jackson>
-
- com.amazonaws.util.json.Jackson
-
- All Implemented Interfaces:
Serializable
,Comparable<Jackson>
public enum Jackson extends Enum<Jackson>
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
fromJsonString(String json, Class<T> clazz)
Returns the deserialized object from the given json string and target class; or null if the given json string is null.static com.fasterxml.jackson.databind.ObjectMapper
getObjectMapper()
static com.fasterxml.jackson.databind.ObjectWriter
getPrettywriter()
static com.fasterxml.jackson.databind.ObjectWriter
getWriter()
static com.fasterxml.jackson.core.JsonGenerator
jsonGeneratorOf(Writer writer)
static com.fasterxml.jackson.databind.JsonNode
jsonNodeOf(String json)
static <T> T
loadFrom(File file, Class<T> clazz)
static String
toJsonPrettyString(Object value)
static String
toJsonString(Object value)
static Jackson
valueOf(String name)
Returns the enum constant of this type with the specified name.static Jackson[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Method Detail
-
values
public static Jackson[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Jackson c : Jackson.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Jackson valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromJsonString
public static <T> T fromJsonString(String json, Class<T> clazz)
Returns the deserialized object from the given json string and target class; or null if the given json string is null.
-
jsonNodeOf
public static com.fasterxml.jackson.databind.JsonNode jsonNodeOf(String json)
-
jsonGeneratorOf
public static com.fasterxml.jackson.core.JsonGenerator jsonGeneratorOf(Writer writer) throws IOException
- Throws:
IOException
-
loadFrom
public static <T> T loadFrom(File file, Class<T> clazz) throws IOException
- Throws:
IOException
-
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-
getWriter
public static com.fasterxml.jackson.databind.ObjectWriter getWriter()
-
getPrettywriter
public static com.fasterxml.jackson.databind.ObjectWriter getPrettywriter()
-
-