Package com.yahoo.collections
Class PredicateSplit<E>
- java.lang.Object
-
- com.yahoo.collections.PredicateSplit<E>
-
public class PredicateSplit<E> extends java.lang.Object
Class holding the result of a partition-by-predicate operation.
-
-
Field Summary
Fields Modifier and Type Field Description java.util.List<E>
falseValues
java.util.List<E>
trueValues
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> PredicateSplit<V>
partition(java.lang.Iterable<V> collection, java.util.function.Predicate<? super V> predicate)
Perform a partition-by-predicate operation.
-
-
-
Method Detail
-
partition
public static <V> PredicateSplit<V> partition(java.lang.Iterable<V> collection, java.util.function.Predicate<? super V> predicate)
Perform a partition-by-predicate operation. Each value in the input is tested by the predicate and added to either the falseValues list or the trueValues list.- Parameters:
collection
- The input collection.predicate
- A test for selecting the target list.- Returns:
- Two lists bundled in an object.
-
-