E - the type of elements held in the adapted collection.C - the type of the adapted collectionpublic class CollectionTransformer<E,C extends Collection<? super E>> extends Object implements Function<Generator<? extends E>,C>
| Constructor and Description |
|---|
CollectionTransformer(C toFill)
Create a new CollectionTransformer.
|
| Modifier and Type | Method and Description |
|---|---|
C |
evaluate(Generator<? extends E> generator)
Run the
Generator adding each element produced into the
collection. |
static <E> CollectionTransformer<E,Collection<E>> |
toCollection()
Get a
CollectionTransformer instance that simply returns any Collection. |
public CollectionTransformer(C toFill)
toFill - Collection to fillNullPointerException - if the collection is nullpublic C evaluate(Generator<? extends E> generator)
Generator adding each element produced into the
collection.public static <E> CollectionTransformer<E,Collection<E>> toCollection()
CollectionTransformer instance that simply returns any Collection.E - the collection typeCollectionTransformerCopyright © 2003–2014 The Apache Software Foundation. All rights reserved.