Package io.fliqa.client.interledger
Class InterledgerObjectMapper
java.lang.Object
io.fliqa.client.interledger.InterledgerObjectMapper
Wrapper around ObjectMapper to provide default mapping and catch serialization/deserialization exceptions
We have two mappers:
- mapper - standard mapper
- unwrapMapper - deserializes content of root JSON element
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newInterledgerObjectMapperinstance by initializing twoObjectMapperobjects: -
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperget()Configures and returns a preconfiguredObjectMapperfor JSON serialization and deserialization.<T> TwriteValueAsString(Object value)
-
Constructor Details
-
InterledgerObjectMapper
public InterledgerObjectMapper()Constructs a newInterledgerObjectMapperinstance by initializing twoObjectMapperobjects:1. A default
ObjectMapper, configured via theget()method. 2. An unwrap-specificObjectMapper, configured via thegetUnwrapMapper()method.These mappers are used for JSON serialization and deserialization, providing preconfigured behavior such as support for
Instanthandling, consistent map entry ordering, and additional unwrap functionality.
-
-
Method Details
-
get
public static com.fasterxml.jackson.databind.ObjectMapper get()Configures and returns a preconfiguredObjectMapperfor JSON serialization and deserialization. The returnedObjectMapperensures consistent ordering of map entries, custom handling ofInstantserialization and deserialization, and omits null values during serialization. It is also configured to ignore unknown properties when deserializing JSON.- Returns:
- a preconfigured
ObjectMapperinstance.
-
writeValueAsString
- Throws:
InterledgerClientException
-
readValue
- Throws:
InterledgerClientException
-
readError
- Throws:
InterledgerClientException
-