Class JsonPatchConverter

  • All Implemented Interfaces:
    PatchConverter<com.fasterxml.jackson.databind.JsonNode>

    public class JsonPatchConverter
    extends Object
    implements PatchConverter<com.fasterxml.jackson.databind.JsonNode>
    Convert JsonNodes containing JSON Patch to/from Patch objects. Based on JsonPatchPatchConverter
    Author:
    Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
    • Constructor Detail

      • JsonPatchConverter

        public JsonPatchConverter​(com.fasterxml.jackson.databind.ObjectMapper mapper)
    • Method Detail

      • convert

        public Patch convert​(com.fasterxml.jackson.databind.JsonNode jsonNode)
        Constructs a Patch object given a JsonNode.
        Specified by:
        convert in interface PatchConverter<com.fasterxml.jackson.databind.JsonNode>
        Parameters:
        jsonNode - a JsonNode containing the JSON Patch
        Returns:
        a Patch
      • convert

        public com.fasterxml.jackson.databind.JsonNode convert​(Patch patch)
        Renders a Patch as a JsonNode.
        Specified by:
        convert in interface PatchConverter<com.fasterxml.jackson.databind.JsonNode>
        Parameters:
        patch - the patch
        Returns:
        a JsonNode containing JSON Patch.