Package org.factcast.core.util
Class FactCastJson
java.lang.Object
org.factcast.core.util.FactCastJson
Statically shared ObjectMapper reader & writer to be used within FactCast for Headers and
FactCast-specific objects.
You must not change the configuration of this mapper, and it should not be used outside of FactCast.
- Author:
- [email protected]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
addSerToHeader
(long ser, String jsonHeader) static <T> T
convertValue
(Object fromValue, Class<T> toValueType) static <T> T
copy
(T toCopy) static com.fasterxml.jackson.databind.ObjectMapper
static com.fasterxml.jackson.databind.ObjectMapper
mapper()
static com.fasterxml.jackson.databind.node.ObjectNode
static String
static com.fasterxml.jackson.databind.JsonNode
static <T> T
static <T> T
readValue
(@NonNull Class<T> class1, @NonNull InputStream json) static <T> T
static <A> A
readValueFromBytes
(Class<A> type, byte[] bytes) static com.fasterxml.jackson.databind.JsonNode
toJsonNode
(Map<String, Object> jsonAsMap) static com.fasterxml.jackson.databind.node.ObjectNode
toObjectNode
(String json) static String
toPrettyString
(String jsonString) static <T> com.fasterxml.jackson.databind.JsonNode
valueToTree
(T object) static byte[]
static String
static <T> String
writeValueAsString
(T value)
-
Constructor Details
-
FactCastJson
public FactCastJson()
-
-
Method Details
-
copy
public static <T> T copy(@NonNull T toCopy) -
writeValueAsString
-
readValue
-
readValue
public static <T> T readValue(@NonNull @NonNull com.fasterxml.jackson.core.type.TypeReference<T> class1, @NonNull @NonNull String json) -
readValue
public static <T> T readValue(@NonNull @NonNull Class<T> class1, @NonNull @NonNull InputStream json) -
toObjectNode
-
newObjectNode
public static com.fasterxml.jackson.databind.node.ObjectNode newObjectNode() -
writeValueAsPrettyString
-
addSerToHeader
-
toPrettyString
-
readJSON
- Throws:
IOException
-
valueToTree
public static <T> com.fasterxml.jackson.databind.JsonNode valueToTree(T object) -
readTree
public static com.fasterxml.jackson.databind.JsonNode readTree(String json) throws com.fasterxml.jackson.core.JsonProcessingException - Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
convertValue
-
toJsonNode
-
writeValueAsBytes
-
readValueFromBytes
-
mapper
public static com.fasterxml.jackson.databind.ObjectMapper mapper() -
getObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
-