public final class CollectionPredicate extends Object
public static <E,T extends Collection<E>> java.util.function.Predicate<T> empty()
E - T - public static <T,E> java.util.function.Predicate<T> empty(java.util.function.Function<T,Collection<E>> source)
T - E - source - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasAny(Collection<E> objects)
E - T - objects - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasAny(E[] objects)
E - T - objects - public static <T,E> java.util.function.Predicate<T> hasAny(java.util.function.Function<T,Collection<E>> source, Collection<E> objects)
T - E - source - objects - public static <T,E> java.util.function.Predicate<T> hasAny(java.util.function.Function<T,Collection<E>> source, E[] objects)
T - E - source - objects - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasItem(E object)
Collection that only matches when a single pass over the
examined Collection yields at least one item that is equal to the specified
object. Whilst matching, the traversal of the examined Collection will
stop as soon as a matching item is found.
ruleForEach(Parent::getNames).must(hasItem("John"));
E - type of objectT - type of exam classobject - the object to compare against the objects provided by the examined
CollectionPredicatepublic static <T,E> java.util.function.Predicate<T> hasItem(java.util.function.Function<T,Collection<E>> source, E object)
T - E - source - object - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasItems(Collection<E> objects)
E - T - objects - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasItems(E[] objects)
E - T - objects - public static <T,E> java.util.function.Predicate<T> hasItems(java.util.function.Function<T,Collection<E>> source, Collection<E> objects)
T - E - source - objects - public static <T,E> java.util.function.Predicate<T> hasItems(java.util.function.Function<T,Collection<E>> source, E[] objects)
T - E - source - objects - public static <T,E> java.util.function.Predicate<T> hasSize(java.util.function.Function<T,Collection<E>> source, Integer size)
T - E - source - size - public static <E,T extends Collection<E>> java.util.function.Predicate<T> hasSize(Integer size)
E - T - size - Copyright © 2019 com.github.mvallim. All rights reserved.