Class ObjectNodeToJsonNodeConverter

java.lang.Object
org.axonframework.serialization.json.ObjectNodeToJsonNodeConverter
All Implemented Interfaces:
ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>

public class ObjectNodeToJsonNodeConverter extends Object implements ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
A ContentTypeConverter implementation for Jackson 2 that converts an ObjectNode object into a JsonNode. Intended to simplify JSON-typed event upcasters, which generally deal with an ObjectNode as the event.

Will succeed converting at all times as an ObjectNode is a JsonNode by definition.

Since:
4.6.0
Author:
Steven van Beelen
  • Constructor Details

    • ObjectNodeToJsonNodeConverter

      public ObjectNodeToJsonNodeConverter()
  • Method Details

    • expectedSourceType

      public Class<com.fasterxml.jackson.databind.node.ObjectNode> expectedSourceType()
      Description copied from interface: ContentTypeConverter
      The expected type of input data.
      Specified by:
      expectedSourceType in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,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: ContentTypeConverter
      The returned type of IntermediateRepresentation
      Specified by:
      targetType in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
      Returns:
      the output data format in IntermediateRepresentation
    • convert

      public com.fasterxml.jackson.databind.JsonNode convert(com.fasterxml.jackson.databind.node.ObjectNode original)
      Description copied from interface: ContentTypeConverter
      Converts the given object into another. Typically, these values are contained by a SerializedObject instance.
      Specified by:
      convert in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
      Parameters:
      original - the value to convert
      Returns:
      the converted value