Interface JsonPatchValueTransformer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface JsonPatchValueTransformer
    RFC6902 expects the patch value to be a predetermined, static value to be used in the patch operation's execution. This class provides a means to extend that behavior to allow for values that require transformation based on the patch target document. This impl is the default used by JsonPatch but may be overridden by calling JsonPatch.patch(JsonValue original, JsonValue patch, JsonPatchValueTransform custom).
    • Method Detail

      • getTransformedValue

        Object getTransformedValue​(JsonValue target,
                                   JsonValue op)
        Return the value to be used for a given patch operation.
        Parameters:
        target - the patch target document. Target is unused by default, made available for use by custom transforms.
        op - the patch operation.
        Returns:
        The value from target pointed to by op, transformed as required by the implementation.
        Throws:
        JsonValueException - when the value cannot be located in the target.