Class ObjectNodeToJsonNodeConverter

java.lang.Object
org.axonframework.conversion.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 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

      @Nonnull public Class<com.fasterxml.jackson.databind.node.ObjectNode> expectedSourceType()
      Description copied from interface: ContentTypeConverter
      Returns the expected type of input data for this ContentTypeConverter to ContentTypeConverter.convert(Object).
      Specified by:
      expectedSourceType in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
      Returns:
      The expected type of input data for this ContentTypeConverter to ContentTypeConverter.convert(Object).
    • targetType

      @Nonnull public Class<com.fasterxml.jackson.databind.JsonNode> targetType()
      Description copied from interface: ContentTypeConverter
      Returns the type of output for this ContentTypeConverter to ContentTypeConverter.convert(Object) into.
      Specified by:
      targetType in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
      Returns:
      The type of output for this ContentTypeConverter to ContentTypeConverter.convert(Object) into.
    • convert

      @Nullable public com.fasterxml.jackson.databind.JsonNode convert(@Nullable com.fasterxml.jackson.databind.node.ObjectNode input)
      Description copied from interface: ContentTypeConverter
      Converts the given input object of generic type S into an object of generic type T.
      Specified by:
      convert in interface ContentTypeConverter<com.fasterxml.jackson.databind.node.ObjectNode,com.fasterxml.jackson.databind.JsonNode>
      Parameters:
      input - The object of generic type S to convert into an object of generic type T.
      Returns:
      The converted version of the given input in type T.