Interface PatchConverter<T>

  • Type Parameters:
    T -
    All Known Implementing Classes:
    JsonPatchConverter

    public interface PatchConverter<T>

    A strategy interface for producing Patch instances from a patch document representation (such as JSON Patch) and rendering a Patch to a patch document representation. This decouples the Patch class from any specific patch format or library that holds the representation.

    For example, if the Patch is to be represented as JSON Patch, the representation type could be JsonNode or some other JSON library's type that holds a JSON document.

    Based on PatchConverter
    Author:
    Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
    • Method Detail

      • convert

        Patch convert​(T patchRepresentation)
        Convert a patch document representation to a Patch.
        Parameters:
        patchRepresentation - the representation of a patch.
        Returns:
        the Patch object that the document represents.
      • convert

        T convert​(Patch patch)
        Convert a Patch to a representation object.
        Parameters:
        patch - the Patch to convert.
        Returns:
        the patch representation object.