public class

JsonPredicate

extends Object
implements Predicate<T> JsonSerializable
java.lang.Object
   ↳ com.urbanairship.json.JsonPredicate

Class Overview

Class abstracting a JSON predicate. The predicate is contained to the following schema:

:= | | | := { "not": { } } := { "and": [, , …] } := { "or": [, , …] }

:= { , "value": { }} | { "value": {}} := , "key": string | "key": string | := "scope": string | "scope": [string, string, …]

:= | | | | := "array_contains": | "array_contains": , "index": number := "at_least": number | "at_most": number | "at_least": number, "at_most": number := "equals": number | string | boolean | object | array := "is_present": boolean := "version_matches": version matcher

Summary

Nested Classes
class JsonPredicate.Builder Builder class. 
@interface JsonPredicate.PredicateType  
Constants
String AND_PREDICATE_TYPE
String NOT_PREDICATE_TYPE
String OR_PREDICATE_TYPE
Public Methods
boolean apply(JsonSerializable value)
boolean equals(Object o)
int hashCode()
static JsonPredicate.Builder newBuilder()
Builder factory method.
static JsonPredicate parse(JsonValue jsonValue)
Parses a JsonValue object into a JsonPredicate.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.Predicate
From interface com.urbanairship.json.JsonSerializable

Constants

public static final String AND_PREDICATE_TYPE

Constant Value: "and"

public static final String NOT_PREDICATE_TYPE

Constant Value: "not"

public static final String OR_PREDICATE_TYPE

Constant Value: "or"

Public Methods

public boolean apply (JsonSerializable value)

public boolean equals (Object o)

public int hashCode ()

public static JsonPredicate.Builder newBuilder ()

Builder factory method.

Returns
  • A new builder instance.

public static JsonPredicate parse (JsonValue jsonValue)

Parses a JsonValue object into a JsonPredicate.

Parameters
jsonValue The predicate as a JsonValue.
Returns
  • The parsed JsonPredicate.
Throws
JsonException If the jsonValue defines invalid JsonPredicate.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.