Class Collected<Value,​Collection extends java.util.Collection<Value>>

  • All Implemented Interfaces:
    Fragile<Collection,​java.lang.RuntimeException>, Single<Collection>

    public final class Collected<Value,​Collection extends java.util.Collection<Value>>
    extends DelegatingSingle<Collection>
    A Single holding the collected values of an Iterable.

    This expects a generator which creates the initial (usually empty) collection and an Iterable which contains the values to collect.

    Example

    
     List<String> valueList = new Collected<>(ArrayList::new, values).value();
     Set<String> valueSet  = new Collected<>(HashSet::new, values).value();
     
    • Constructor Summary

      Constructors 
      Constructor Description
      Collected​(Generator<? extends Collection> collectionGenerator, java.lang.Iterable<? extends Value> values)  
    • Method Summary

      • Methods inherited from class java.lang.Object

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

      • Collected

        public Collected​(Generator<? extends Collection> collectionGenerator,
                         java.lang.Iterable<? extends Value> values)