Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • falseValues

        public final java.util.List<E> falseValues
      • trueValues

        public final java.util.List<E> trueValues
    • 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.