/** * Create a new Predicate operation * * @param operation * @param args * @return */ public static BooleanExpression predicate(Operator<Boolean> operation, Expression<?>... args) { return BooleanOperation.create(operation, args); }
/** * @param str * @return */ public BooleanExpression startsWithIgnoreCase(Expression<String> str) { return BooleanOperation.create(Ops.STARTS_WITH_IC, mixin, str); }
@Override public BooleanExpression exists() { if (exists == null) { exists = BooleanOperation.create(Ops.EXISTS, mixin); } return exists; }
@Override public BooleanExpression exists() { if (exists == null) { exists = BooleanOperation.create(Ops.EXISTS, mixin); } return exists; } @Override
/** * Create a {@code this is not null} expression * * @return */ public BooleanExpression isNotNull() { if (isnotnull == null) { isnotnull = BooleanOperation.create(Ops.IS_NOT_NULL, mixin); } return isnotnull; }
/** * Create a {@code this is null} expression * * @return */ public BooleanExpression isNull() { if (isnull == null) { isnull = BooleanOperation.create(Ops.IS_NULL, mixin); } return isnull; }
/** * Get a {@code this in right} expression * * @param right rhs of the comparison * @return */ public BooleanExpression in(CollectionExpression<?,? extends T> right) { return BooleanOperation.create(Ops.IN, mixin, right); }
/** * @param str * @return */ public BooleanExpression endsWithIgnoreCase(Expression<String> str) { return BooleanOperation.create(Ops.ENDS_WITH_IC, mixin, str); }
/** * Compares this {@code StringExpression} to another {@code StringExpression}, ignoring case * considerations. * * @param str * @return this.equalsIgnoreCase(str) * @see java.lang.String#equalsIgnoreCase(String) */ public BooleanExpression equalsIgnoreCase(Expression<String> str) { return BooleanOperation.create(Ops.EQ_IGNORE_CASE, mixin, str); }
/** * Return true if this starts with str * * @param str * @return this.startsWith(str) * @see java.lang.String#startsWith(String) */ public BooleanExpression startsWith(Expression<String> str) { return BooleanOperation.create(Ops.STARTS_WITH, mixin, str); }
/** * Get a {@code this > right} expression * * @param right rhs of the comparison * @return * @see java.lang.Comparable#compareTo(Object) */ public BooleanExpression gt(Expression<T> right) { return BooleanOperation.create(Ops.GT, mixin, right); }
/** * Get a {@code this <= right} expression * * @param right rhs of the comparison * @return * @see java.lang.Comparable#compareTo(Object) */ public final BooleanExpression loe(Expression<T> right) { return BooleanOperation.create(Ops.LOE, mixin, right); }
@Override public BooleanExpression exists() { if (exists == null) { exists = BooleanOperation.create(Ops.EXISTS, mixin); } return exists; }
/** * Get a {@code this not in right} expression * * @param right rhs of the comparison * @return */ public final BooleanExpression notIn(CollectionExpression<?,? extends T> right) { return BooleanOperation.create(Ops.NOT_IN, mixin, right); }
/** * Expr: {@code this like str} ignoring case. * * @param str string * @return this like string */ public BooleanExpression likeIgnoreCase(String str) { return BooleanOperation.create(Ops.LIKE_IC, mixin, ConstantImpl.create(str)); }
/** * Create an {@code this instanceOf type} expression * * @param <B> * @param type * @return */ public <B extends T> BooleanExpression instanceOf(Class<B> type) { return BooleanOperation.create(Ops.INSTANCE_OF, pathMixin, ConstantImpl.create(type)); }
/** * Finds the closest points relative to the given location on a sphere and orders the results with decreasing proximity * * @param expr * @param latVal latitude * @param longVal longitude * @return */ public static BooleanExpression nearSphere(Expression<Double[]> expr, double latVal, double longVal) { return BooleanOperation.create(MongodbOps.NEAR_SPHERE, expr, ConstantImpl.create(new Double[]{latVal, longVal})); }
/** * Expr: {@code this like str} ignoring case * * @param str string * @param escape escape character * @return this like string */ public BooleanExpression likeIgnoreCase(Expression<String> str, char escape) { return BooleanOperation.create(Ops.LIKE_ESCAPE_IC, mixin, str, ConstantImpl.create(escape)); }
/** * Get a {@code this <= right} expression * * @param right rhs of the comparison * @return * @see java.lang.Comparable#compareTo(Object) */ public final BooleanExpression loe(T right) { return BooleanOperation.create(Ops.LOE, mixin, ConstantImpl.create(right)); }
/** * Expr: {@code this like str} * * @param str * @return */ public BooleanExpression like(String str) { return BooleanOperation.create(Ops.LIKE, stringValue(), ConstantImpl.create(str)); }