java.lang.Object | |
↳ | com.urbanairship.json.ValueMatcher |
Class representing the field matching type and values contained in a JsonMatcher.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ValueMatcher() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | apply(JsonSerializable jsonSerializable) | ||||||||||
static ValueMatcher |
newArrayContainsMatcher(JsonPredicate predicate, int index)
Creates a new array contains matcher for a specific value in the array.
| ||||||||||
static ValueMatcher |
newArrayContainsMatcher(JsonPredicate predicate)
Creates a new array contains matcher that will check the entire array.
| ||||||||||
static ValueMatcher |
newIsAbsentMatcher()
Creates a new value matcher for when a field should be absent.
| ||||||||||
static ValueMatcher |
newIsPresentMatcher()
Creates a new value matcher for when a field should be present.
| ||||||||||
static ValueMatcher |
newNumberRangeMatcher(Double min, Double max)
Creates a new number range value matcher.
| ||||||||||
static ValueMatcher |
newValueMatcher(JsonValue value)
Creates a new value matcher.
| ||||||||||
static ValueMatcher |
newVersionMatcher(String constraint)
Creates a new value matcher for a semantic version string
| ||||||||||
static ValueMatcher |
parse(JsonValue jsonValue)
Parses a JsonValue object into a ValueMatcher.
| ||||||||||
String | toString() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract boolean |
apply(JsonValue jsonValue, boolean ignoreCase)
Matches a json value.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.urbanairship.Predicate
| |||||||||||
From interface
com.urbanairship.json.JsonSerializable
|
Creates a new array contains matcher for a specific value in the array.
predicate | The predicate to apply to the value at the specified index. |
---|---|
index | The index of the value. |
Creates a new array contains matcher that will check the entire array.
predicate | The predicate to apply to each value of the array. |
---|
Creates a new value matcher for when a field should be absent.
Creates a new value matcher for when a field should be present.
Creates a new number range value matcher.
min | Optional minimum value as a double. |
---|---|
max | Optional maximum value as a double. |
IllegalArgumentException | if min is greater than max. |
---|
Creates a new value matcher.
value | The value to apply as a JsonValue. |
---|
Creates a new value matcher for a semantic version string
IllegalArgumentException | If the constraint is not a valid ivy version constraint. |
---|
Parses a JsonValue object into a ValueMatcher.
jsonValue | The predicate as a JsonValue. |
---|
JsonException |
---|
Matches a json value.
jsonValue | The json value. |
---|---|
ignoreCase | true to ignore case when checking String values, false to check case. |
true
if the value matches, otherwise false
.