Trigger implements Parcelable, JsonSerializable { @NonNull public static Trigger fromJson(@NonNull JsonValue value) throws JsonException { JsonMap jsonMap = value.optMap(); @TriggerType int type; JsonPredicate predicate = jsonMap.containsKey(PREDICATE_KEY) ? JsonPredicate.parse(jsonMap.opt(PREDICATE_KEY)) : null; double goal = jsonMap.opt(GOAL_KEY).getDouble(-1); if (!(goal > 0)) { throw new JsonException("Trigger goal must be defined and greater than 0."); } String typeString = jsonMap.opt(TYPE_KEY).optString().toLowerCase(Locale.ROOT); try { type = convertType(typeString); } catch (IllegalArgumentException e) { throw new JsonException("Invalid trigger type: " + typeString); } return new Trigger(type, goal, predicate); } @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  Trigger(@TriggerType int type, double goal, @Nullable JsonPredicate predicate);  Trigger(@NonNull Parcel in); @Override void writeToParcel(@NonNull Parcel dest, int flags); @NonNull @Override JsonValue toJsonValue(); @Override int describeContents(); @TriggerType int getType(); double getGoal(); @Nullable JsonPredicate getPredicate(); @NonNull static Trigger fromJson(@NonNull JsonValue value); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @NonNull String getTriggerName(); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Override String toString(); static final int LIFE_CYCLE_FOREGROUND; static final int LIFE_CYCLE_BACKGROUND; static final int REGION_ENTER; static final int REGION_EXIT; static final int CUSTOM_EVENT_COUNT; static final int CUSTOM_EVENT_VALUE; static final int SCREEN_VIEW; static final int LIFE_CYCLE_APP_INIT; static final int ACTIVE_SESSION; static final int VERSION; @NonNull
    static final Creator<Trigger> CREATOR; }
@Test(expected = JsonException.class) public void testParseEmptyJson() throws JsonException { Trigger.fromJson(JsonValue.NULL); }