MCPcopy Create free account
hub / github.com/Card-Forge/forge / and

Method and

forge-core/src/main/java/forge/util/IterableUtil.java:21–25  ·  view source on GitHub ↗

Merges a collection of predicates into a single predicate, which requires the subject to match each of the component predicates.

(Iterable<? extends Predicate<? super T>> components)

Source from the content-addressed store, hash-verified

19 * which requires the subject to match each of the component predicates.
20 */
21 public static <T> Predicate<T> and(Iterable<? extends Predicate<? super T>> components) {
22 if(components instanceof List && ((List<?>) components).size() == 1)
23 return ((List<? extends Predicate<? super T>>) components).get(0)::test;
24 return x -> all(components, i -> i.test(x));
25 }
26
27 /**
28 * Merges a collection of predicates into a single predicate,

Callers 15

filterMethod · 0.95
filterAsListMethod · 0.95
initializeAllCardsMethod · 0.95
applyFiltersMethod · 0.95
applyFiltersMethod · 0.95
buildExtraPredicateMethod · 0.95
parseRewardMethod · 0.95
applyFiltersMethod · 0.95
buildFilterMethod · 0.80
getPredicateMethod · 0.80

Calls 4

allMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
testMethod · 0.45

Tested by 3

initializeCardsMethod · 0.64
initializeCardsMethod · 0.64
initializeCardsMethod · 0.64