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 Summary
Modifier and TypeMethodDescriptionconditional(Consumer<JsonOperations.JsonSetSpec> consumer) Apply a condition to the set operation through aJsonOperations.JsonSetSpec.Set the JSONvalueat the configured path.default BooleansetIfAbsent(T value) Set the JSONvalueat the configured path only if the path has no matches (NX).default BooleansetIfPresent(T value) Set the JSONvalueat the configured path only if the path has one or more matches (XX).
-
Method Details
-
conditional
@CheckReturnValue JsonOperations.JsonSet<T,S> conditional(Consumer<JsonOperations.JsonSetSpec> consumer) Apply a condition to the set operation through aJsonOperations.JsonSetSpec.- Parameters:
consumer- callback to configure the condition.- Returns:
- a new spec instance.
-
set
-
setIfPresent
-
setIfAbsent
-