/** * A convenience shortcut for building IN expression. Return ASTFalse for * empty collection. */ public static Expression inExp(String pathSpec, Object... values) { return inExp(new ASTObjPath(pathSpec), values); }
/** * @return An expression for finding objects with values in the given set. */ public Expression in(E firstValue, E... moreValues) { int moreValuesLength = moreValues != null ? moreValues.length : 0; Object[] values = new Object[moreValuesLength + 1]; values[0] = firstValue; if (moreValuesLength > 0) { System.arraycopy(moreValues, 0, values, 1, moreValuesLength); } return ExpressionFactory.inExp(getExpression(), values); }
/** * A convenience shortcut for building IN expression. Return ASTFalse for * empty collection. */ public static Expression inExp(String pathSpec, Collection<?> values) { return inExp(new ASTObjPath(pathSpec), values); }
/** * @return An expression for finding objects with values in the given set. */ public Expression in(Collection<E> values) { return ExpressionFactory.inExp(getExpression(), values); }
@SuppressWarnings("rawtypes") Expression in(Filter filter) { if (!(filter.getValue() instanceof List)) { return eq(filter); } return inExp(filter.getProperty(), (List) filter.getValue()); }