Interface JsonOperations.JsonSet<T, S extends JsonOperations.JsonSet<T,S>>

Type Parameters:
T - value type.
S - self-type used for fluent method chaining.
All Known Subinterfaces:
JsonOperations.JsonAtKeySpec, JsonOperations.JsonBooleanSpec, JsonOperations.JsonStringSpec
Enclosing interface:
JsonOperations<K>

public static interface JsonOperations.JsonSet<T, S extends JsonOperations.JsonSet<T,S>>
Common support for setting JSON values at the currently configured path.
Since:
4.2
Author:
Mark Paluch, Yordan Tsintsov, Moritz Halbritter
See Also:
  • Method Details

    • conditional

      Apply a condition to the set operation through a JsonOperations.JsonSetSpec.
      Parameters:
      consumer - callback to configure the condition.
      Returns:
      a new spec instance.
    • set

      Boolean set(T value)
      Set the JSON value at the configured path.
      Parameters:
      value - the value to write.
      Returns:
      true if the value was written; false otherwise.
      See Also:
    • setIfPresent

      default Boolean setIfPresent(T value)
      Set the JSON value at the configured path only if the path has one or more matches (XX).
      Parameters:
      value - the value to write.
      Returns:
      true if the value was written; false otherwise.
    • setIfAbsent

      default Boolean setIfAbsent(T value)
      Set the JSON value at the configured path only if the path has no matches (NX).
      Parameters:
      value - the value to write.
      Returns:
      true if the value was written; false otherwise.