Predicate
public protocol Predicate : Decodable, Encodable, Hashable, Sendable
A protocol for defining the specific logic of a JSON value matcher. Each predicate implementation checks a JSON value against a specific condition.
-
Evaluates the predicate against a given JSON value.
Declaration
Swift
func evaluate(json: AirshipJSON, ignoreCase: Bool) -> Bool
Parameters
json
The
AirshipJSON
value to evaluate.ignoreCase
If
true
, string comparisons will be case-insensitive.Return Value
true
if the JSON value matches the predicate’s conditions, otherwisefalse
. -
Checks if this predicate is equal to another predicate.
Declaration
Swift
func isEqual(to other: any Predicate) -> Bool
Parameters
other
The other predicate to compare against.
Return Value
true
if the predicates are equal, otherwisefalse
.