public static interface UpdateConstraint.PartialJSON extends UpdateConstraint
JSON topic to match the partially described
value.
The code:
Constraint.Factory factory = Diffusion.updateConstraints();
PartialJSON constraint =
factory.jsonValue()
.with("/id", String.class, idValue)
.without("/cancellation");
creates a constraint for a JSON object with a specific ID value and no
value for a "cancellation" property.
Missing keys are matched differently to keys that are present with null values.
UpdateConstraint.Factory, UpdateConstraint.PartialJSON| Modifier and Type | Method and Description |
|---|---|
<V> UpdateConstraint.PartialJSON |
with(String pointer,
Class<V> valueClass,
V value)
Require a value at a specific position in the JSON object.
|
UpdateConstraint.PartialJSON |
without(String pointer)
Require a specific position in the JSON object to be absent.
|
and<V> UpdateConstraint.PartialJSON with(String pointer, Class<V> valueClass, V value)
The pointer is a
JSON Pointer
syntax reference locating the value in the JSON object.
Only string, int64, and double values are supported. The null value may be passed for any type.
V - the value type of the value at the pointerpointer - the pointer expressionvalueClass - the value classvalue - the valueIllegalArgumentException - if the pointer
parameter cannot be parsed as a
JSON pointer or if the value
class is not one of String,
Long or Double.UpdateConstraint.PartialJSON without(String pointer)
The pointer is a
JSON Pointer
syntax reference that should have no value in the JSON object.
pointer - the pointer expressionIllegalArgumentException - if the pointer
parameter cannot be parsed as a
JSON pointerCopyright © 2023 DiffusionData Limited. All rights reserved.