public final class Collected<Value,Collection extends java.util.Collection<Value>> extends DelegatingSingle<Collection>
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 and Description |
|---|
Collected(Generator<Collection> collectionGenerator,
java.lang.Iterable<Value> values) |
valuepublic Collected(Generator<Collection> collectionGenerator, java.lang.Iterable<Value> values)