switch (predicate) { case "and": return new AndP((List<P>) value); case "or": return new OrP((List<P>) value);
@Override public P<V> and(final Predicate<? super V> predicate) { if (!(predicate instanceof P)) throw new IllegalArgumentException("Only P predicates can be and'd together"); return new AndP<>(Arrays.asList(this, (P<V>) predicate)); }
@Override public P<V> and(final Predicate<? super V> predicate) { if (!(predicate instanceof P)) throw new IllegalArgumentException("Only P predicates can be and'd together"); return new AndP<>(Arrays.asList(this, (P<V>) predicate)); }
@Override public P<V> negate() { super.negate(); return new AndP<>(this.predicates); }
/** * Determines if a value is within (inclusive) of the range of the two specified values. * * @since 3.0.0-incubating */ public static <V> P<V> between(final V first, final V second) { return new AndP<V>(Arrays.asList(new P(Compare.gte, first), new P(Compare.lt, second))); }
/** * Determines if a value is within (exclusive) the range of the two specified values. * * @since 3.0.0-incubating */ public static <V> P<V> inside(final V first, final V second) { return new AndP<V>(Arrays.asList(new P(Compare.gt, first), new P(Compare.lt, second))); }
return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value); else if (value instanceof Collection) { if (predicate.equals("between"))
return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value); else if (value instanceof Collection) { if (predicate.equals("between"))
return predicate.equals(GraphSONTokens.AND) ? new AndP((List<P>) value) : new OrP((List<P>) value); } else if (predicate.equals(GraphSONTokens.NOT) && value instanceof P) { return P.not((P<?>) value);
return predicate.equals(GraphSONTokens.AND) ? new AndP((List<P>) value) : new OrP((List<P>) value); } else if (predicate.equals(GraphSONTokens.NOT) && value instanceof P) { return P.not((P<?>) value);
@Override public P<V> and(final Predicate<? super V> predicate) { if (!(predicate instanceof P)) throw new IllegalArgumentException("Only P predicates can be and'd together"); return new AndP<>(Arrays.asList(this, (P<V>) predicate)); }
@Override public P<V> and(final Predicate<? super V> predicate) { if (!(predicate instanceof P)) throw new IllegalArgumentException("Only P predicates can be and'd together"); return new AndP<>(Arrays.asList(this, (P<V>) predicate)); }
@Override public P<V> negate() { super.negate(); return new AndP<>(this.predicates); }
/** * Determines if a value is within (inclusive) of the range of the two specified values. * * @since 3.0.0-incubating */ public static <V> P<V> between(final V first, final V second) { return new AndP<V>(Arrays.asList(new P(Compare.gte, first), new P(Compare.lt, second))); }
/** * Determines if a value is within (exclusive) the range of the two specified values. * * @since 3.0.0-incubating */ public static <V> P<V> inside(final V first, final V second) { return new AndP<V>(Arrays.asList(new P(Compare.gt, first), new P(Compare.lt, second))); }
public static <V> P<V> inside(final V first, final V second) { return new AndP<>(Arrays.asList(new P(DatePredicate.gt, first), new P(DatePredicate.lt, second))); } public static <V> P<V> outside(final V first, final V second) {
return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value); else if (value instanceof Collection) { if (predicate.equals("between"))
public static <V> P<V> between(final V first, final V second) { return new AndP<>(Arrays.asList(new P(DatePredicate.gte, first), new P(DatePredicate.lt, second))); }
return predicate.equals("and") ? new AndP((List<P>) value) : new OrP((List<P>) value); else if (value instanceof Collection) { if (predicate.equals("between"))
return predicate.equals(GraphSONTokens.AND) ? new AndP((List<P>) value) : new OrP((List<P>) value); } else if (predicate.equals(GraphSONTokens.NOT) && value instanceof P) { return P.not((P<?>) value);