Class JacksonEventSerializer
java.lang.Object
org.springframework.modulith.events.jackson.JacksonEventSerializer
- All Implemented Interfaces:
EventSerializer
A Jackson-based
EventSerializer
.- Author:
- Oliver Drotbohm
-
Constructor Summary
ConstructorDescriptionJacksonEventSerializer
(Supplier<com.fasterxml.jackson.databind.ObjectMapper> mapper) Creates a newJacksonEventSerializer
for the givenObjectMapper
. -
Method Summary
-
Constructor Details
-
JacksonEventSerializer
Creates a newJacksonEventSerializer
for the givenObjectMapper
.- Parameters:
mapper
- must not be null.
-
-
Method Details
-
serialize
Description copied from interface:EventSerializer
Serializes the given event into a storable format.- Specified by:
serialize
in interfaceEventSerializer
- Parameters:
event
- must not be null.- Returns:
- will never be null.
-
deserialize
Description copied from interface:EventSerializer
Deserializes the event from the serialization format into an instance of the given type.- Specified by:
deserialize
in interfaceEventSerializer
- Parameters:
serialized
- must not be null.type
- must not be null.- Returns:
- will never be null.
-