public static interface UpdateConstraint.Factory
An instance can be obtained by calling
Diffusion.updateConstraints()
.
Modifier and Type | Method and Description |
---|---|
UpdateConstraint.PartialJSON |
jsonValue()
Create a constraint that partially matches the current topic value.
|
UpdateConstraint |
locked(Session.SessionLock lock)
Create a constraint requiring a lock to be held by the session.
|
UpdateConstraint |
noTopic()
Create a constraint requiring the path to have no topic.
|
UpdateConstraint |
noValue()
Create a constraint requiring the topic to have no value.
|
<V> UpdateConstraint |
value(V value)
Create a constraint requiring the current value of a topic to match
the supplied value.
|
UpdateConstraint locked(Session.SessionLock lock)
This can be used to coordinate operations between multiple sessions.
lock
- the lock<V> UpdateConstraint value(V value)
When a string
, int64
or double
topic is updated to a null
value, the topic is set to have no value. Use the noValue()
constraint to check if the topic has no value.
This is useful when changing the value of a topic. This constraint is unsatisfied if no topic is present at the path, making it unsuitable for operations that try to add topics.
V
- the value typevalue
- the valueUpdateConstraint noValue()
This is useful when setting the first value of a topic. This constraint is unsatisfied if no topic is present at the path, making it unsuitable for operations that try to add topics.
UpdateConstraint noTopic()
This is useful when setting the first value of a topic being added
using addAndSet
without changing the
value if the topic already exists. This constraint is unsatisfied
if a topic is present at the path, making it unsuitable for
operations that try to set topics without adding them.
UpdateConstraint.PartialJSON jsonValue()
The topic must be a JSON
topic. The
UpdateConstraint.PartialJSON
partially describes the
structure of a JSON
value.
Copyright © 2022 Push Technology Ltd. All Rights Reserved.