A
- the iterable element typeC
- the resulting collection typepublic final class ToCollection<A,C extends Collection<A>> extends Object implements Fn2<Fn0<C>,Iterable<A>,C>
Fn0
of some Collection
C
, create an instance of C
and add all of
the elements in the provided Iterable
to the instance. Note that instances of C
must
support Collection.add(E)
(which is to say, must not throw on invocation).Modifier and Type | Method and Description |
---|---|
C |
checkedApply(Fn0<C> cFn0,
Iterable<A> as) |
static <A,C extends Collection<A>> |
toCollection() |
static <A,C extends Collection<A>> |
toCollection(Fn0<C> cFn0) |
static <A,C extends Collection<A>> |
toCollection(Fn0<C> cFn0,
Iterable<A> as) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, apply, checkedApply, compose, contraMap, curried, curry, diMapL, discardR, flip, fn2, fromBiFunction, toBiFunction, uncurry, widen
public C checkedApply(Fn0<C> cFn0, Iterable<A> as)
checkedApply
in interface Fn2<Fn0<C extends Collection<A>>,Iterable<A>,C extends Collection<A>>
public static <A,C extends Collection<A>> ToCollection<A,C> toCollection()
public static <A,C extends Collection<A>> Fn1<Iterable<A>,C> toCollection(Fn0<C> cFn0)
public static <A,C extends Collection<A>> C toCollection(Fn0<C> cFn0, Iterable<A> as)