Enum JsonPatch.Operation

java.lang.Object
java.lang.Enum<JsonPatch.Operation>
org.eclipse.ditto.json.JsonPatch.Operation
All Implemented Interfaces:
Serializable, Comparable<JsonPatch.Operation>, java.lang.constant.Constable
Enclosing interface:
JsonPatch

public static enum JsonPatch.Operation extends Enum<JsonPatch.Operation>
Enumeration defining the supported JSON Patch operation types.
  • Enum Constant Details

    • ADD

      public static final JsonPatch.Operation ADD
      Used to define additions/insertions on a path.
    • REMOVE

      public static final JsonPatch.Operation REMOVE
      Used to define deletions on a path.
    • REPLACE

      public static final JsonPatch.Operation REPLACE
      Used to change values assigned to a path.
  • Method Details

    • values

      public static JsonPatch.Operation[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static JsonPatch.Operation valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • fromString

      public static Optional<JsonPatch.Operation> fromString(@Nullable String name)
      Defines the reverse operation of #toString method to be able to convert a string representation of an operation to its corresponding enumeration element.
      Parameters:
      name - the operation name.
      Returns:
      the Operation.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<JsonPatch.Operation>