Package org.knowm.xchange.utils
Class ObjectMapperHelper
java.lang.Object
org.knowm.xchange.utils.ObjectMapperHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
static <T> T
static <T> T
readValueStrict
(String value, Class<T> valueType) static <T> String
toCompactJSON
(T valueType) static <T> String
toJSON
(T valueType) static <T> T
viaJSON
(T valueType) Useful for testing.
-
Method Details
-
readValue
- Throws:
IOException
-
readValue
- Throws:
IOException
-
readValueStrict
- Throws:
IOException
-
toJSON
-
toCompactJSON
-
viaJSON
Useful for testing. Performs a round trip via a JSON string allowing ser/deser to be tested andv erified.Note that this deliberately uses a very strict
ObjectMapper
since we need to be sure that the source object is fully recreated without errors.- Type Parameters:
T
- The object type- Parameters:
valueType
- The object to be converted- Returns:
- A copy of the object performed via JSON.
- Throws:
IOException
- If there are deserialization issues.
-