Class TestOperation

  • All Implemented Interfaces:
    com.fasterxml.jackson.databind.JsonSerializable, com.github.fge.jsonpatch.operation.JsonPatchOperation, CidsBeanPatchOperation

    public class TestOperation
    extends com.github.fge.jsonpatch.operation.TestOperation
    implements CidsBeanPatchOperation
    JSON Patch test operation.

    The two arguments for this operation are the pointer containing the value to test (path) and the value to test equality against (value).

    It is an error if no value exists at the given path.

    Also note that equality as defined by JSON Patch is exactly the same as it is defined by JSON Schema itself. As such, this operation reuses JsonNumEquals for testing equality.

    Version:
    $Revision$, $Date$
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable

        com.fasterxml.jackson.databind.JsonSerializable.Base
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static ResourceBundle RESOURCE_BUNDLE  
      • Fields inherited from class com.github.fge.jsonpatch.operation.TestOperation

        EQUIVALENCE, OPERATION_NAME
      • Fields inherited from class com.github.fge.jsonpatch.operation.PathValueOperation

        BUNDLE, op, path, value
    • Constructor Summary

      Constructors 
      Constructor Description
      TestOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path, com.fasterxml.jackson.databind.JsonNode value)
      Creates a new TestOperation object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      de.cismet.cids.dynamics.CidsBean apply​(de.cismet.cids.dynamics.CidsBean cidsBean)
      Apply this operation to a JSON value.
      • Methods inherited from class com.github.fge.jsonpatch.operation.TestOperation

        apply
      • Methods inherited from class com.github.fge.jsonpatch.operation.PathValueOperation

        serialize, serializeWithType, toString
      • Methods inherited from interface com.github.fge.jsonpatch.operation.JsonPatchOperation

        apply, toString
      • Methods inherited from interface com.fasterxml.jackson.databind.JsonSerializable

        serialize, serializeWithType
    • Field Detail

      • RESOURCE_BUNDLE

        protected static final ResourceBundle RESOURCE_BUNDLE
    • Constructor Detail

      • TestOperation

        public TestOperation​(com.github.fge.jackson.jsonpointer.JsonPointer path,
                             com.fasterxml.jackson.databind.JsonNode value)
        Creates a new TestOperation object.
        Parameters:
        path - DOCUMENT ME!
        value - DOCUMENT ME!
    • Method Detail

      • apply

        public de.cismet.cids.dynamics.CidsBean apply​(de.cismet.cids.dynamics.CidsBean cidsBean)
                                               throws com.github.fge.jsonpatch.JsonPatchException
        Description copied from interface: CidsBeanPatchOperation
        Apply this operation to a JSON value.
        Specified by:
        apply in interface CidsBeanPatchOperation
        Parameters:
        cidsBean - the value to patch
        Returns:
        the patched value
        Throws:
        com.github.fge.jsonpatch.JsonPatchException - com.github.fge.jsonpatch.JsonPatchException operation failed to apply to this value