Class ByteArrayToJsonNodeConverter
- java.lang.Object
-
- io.axoniq.dataprotection.serialization.json.ByteArrayToJsonNodeConverter
-
- All Implemented Interfaces:
ContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>
public class ByteArrayToJsonNodeConverter extends Object implements ContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>
ContentTypeConverter implementation that converts byte[] containing UTF8 encoded JSON string to a Jackson JsonNode.- Since:
- 2.2
- Author:
- Allard Buijze
-
-
Constructor Summary
Constructors Constructor Description ByteArrayToJsonNodeConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)Initialize the Converter, using givenobjectMapperto parse the binary contents
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.JsonNodeconvert(byte[] original)Converts the given object into another.Class<byte[]>expectedSourceType()The expected type of input data.Class<com.fasterxml.jackson.databind.JsonNode>targetType()The returned type of IntermediateRepresentation
-
-
-
Constructor Detail
-
ByteArrayToJsonNodeConverter
public ByteArrayToJsonNodeConverter(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Initialize the Converter, using givenobjectMapperto parse the binary contents- Parameters:
objectMapper- the Jackson ObjectMapper to parse the byte array with
-
-
Method Detail
-
expectedSourceType
public Class<byte[]> expectedSourceType()
Description copied from interface:ContentTypeConverterThe expected type of input data.- Specified by:
expectedSourceTypein interfaceContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>- Returns:
- the expected data format in IntermediateRepresentation
-
targetType
public Class<com.fasterxml.jackson.databind.JsonNode> targetType()
Description copied from interface:ContentTypeConverterThe returned type of IntermediateRepresentation- Specified by:
targetTypein interfaceContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>- Returns:
- the output data format in IntermediateRepresentation
-
convert
public com.fasterxml.jackson.databind.JsonNode convert(byte[] original)
Description copied from interface:ContentTypeConverterConverts the given object into another. Typically, these values are contained by aSerializedObjectinstance.- Specified by:
convertin interfaceContentTypeConverter<byte[],com.fasterxml.jackson.databind.JsonNode>- Parameters:
original- the value to convert- Returns:
- the converted value
-
-