public static String randomAlphabeticStringWithSpace(int length) { IntPredicate isAlphabetic = Character::isAlphabetic; IntPredicate isSpace = Character::isSpaceChar; return random(length, 'A', 'z', isAlphabetic.or(isSpace)); }
public static String randomAlphanumericString(int length) { IntPredicate isAlphabetic = Character::isAlphabetic; IntPredicate isDigit = Character::isDigit; return random(length, '0', 'z', isAlphabetic.or(isDigit)); }
/** * Returns a composed predicate that represents a short-circuiting logical * OR of this predicate and another. When evaluating the composed * predicate, if this predicate is {@code true}, then the {@code other} * predicate is not evaluated. * <p> * <p>Any exceptions thrown during evaluation of either predicate are relayed * to the caller; if evaluation of this predicate throws an exception, the * {@code other} predicate will not be evaluated. * * @param other a predicate that will be logically-ORed with this * predicate * @return a composed predicate that represents the short-circuiting logical * OR of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ @Override public IntPredicate or(IntPredicate other) { if (other instanceof IntSetPredicate) { return new IntSetPredicate(set.union(((IntSetPredicate)other).set)); } else { return IntPredicate.super.or(other); } }
/** * Returns a composed predicate that represents a short-circuiting logical * OR of this predicate and another. When evaluating the composed * predicate, if this predicate is {@code true}, then the {@code other} * predicate is not evaluated. * <p> * <p>Any exceptions thrown during evaluation of either predicate are relayed * to the caller; if evaluation of this predicate throws an exception, the * {@code other} predicate will not be evaluated. * * @param other a predicate that will be logically-ORed with this * predicate * @return a composed predicate that represents the short-circuiting logical * OR of this predicate and the {@code other} predicate * @throws NullPointerException if other is null */ @Override public IntPredicate or(IntPredicate other) { if (other instanceof IntSetPredicate) { return new IntSetPredicate(set.union(((IntSetPredicate)other).set)); } else { return IntPredicate.super.or(other); } }
for (Map.Entry<String, Category> entry : CATEGORIES.entrySet()) { if (entry.getKey().charAt(0) == ch) { ip = ip == null ? entry.getValue() : ip.or(entry.getValue());
@Override public IntPredicate getMatcher(NodeVectorTree tree) { switch (operator) { case Token.UNION: return nodetest1.getMatcher(tree).or(nodetest2.getMatcher(tree)); case Token.INTERSECT: return nodetest1.getMatcher(tree).and(nodetest2.getMatcher(tree)); case Token.EXCEPT: return new IntExceptPredicate(nodetest1.getMatcher(tree), nodetest2.getMatcher(tree)); default: throw new IllegalArgumentException("Unknown operator in Combined Node Test"); } }
@Override public IntPredicate getMatcher(NodeVectorTree tree) { switch (operator) { case Token.UNION: return nodetest1.getMatcher(tree).or(nodetest2.getMatcher(tree)); case Token.INTERSECT: return nodetest1.getMatcher(tree).and(nodetest2.getMatcher(tree)); case Token.EXCEPT: return new IntExceptPredicate(nodetest1.getMatcher(tree), nodetest2.getMatcher(tree)); default: throw new IllegalArgumentException("Unknown operator in Combined Node Test"); } }
for (Map.Entry<String, Category> entry : CATEGORIES.entrySet()) { if (entry.getKey().charAt(0) == ch) { ip = ip == null ? entry.getValue() : ip.or(entry.getValue());