Class ToMap<K,V,M extends java.util.Map<K,V>>
- java.lang.Object
-
- com.jnape.palatable.lambda.functions.builtin.fn2.ToMap<K,V,M>
-
- Type Parameters:
K
- the key element typeV
- the value element typeM
- the resulting map type
- All Implemented Interfaces:
Fn1<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>>
,Fn2<Fn0<M>,java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>
,Applicative<Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
,Cartesian<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<?,?>>
,Cocartesian<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<?,?>>
,Contravariant<Fn0<M>,Profunctor<?,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<?,?>>>
,Functor<Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
,Profunctor<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<?,?>>
,Monad<Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
,MonadReader<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
,MonadRec<Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
,MonadWriter<Fn0<M>,Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>,Fn1<Fn0<M>,?>>
public final class ToMap<K,V,M extends java.util.Map<K,V>> extends java.lang.Object implements Fn2<Fn0<M>,java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>
Given anFn0
of someMap
M
, create an instance ofM
and put all of the entries in the providedIterable
into the instance. Note that instances ofM
must supportMap.put(K, V)
(which is to say, must not throw on invocation).
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ToMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description M
checkedApply(Fn0<M> mFn0, java.lang.Iterable<? extends java.util.Map.Entry<K,V>> entries)
static <K,V,M extends java.util.Map<K,V>>
ToMap<K,V,M>toMap()
static <K,V,M extends java.util.Map<K,V>>
Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M>toMap(Fn0<M> mFn0)
static <K,V,M extends java.util.Map<K,V>>
MtoMap(Fn0<M> mFn0, java.lang.Iterable<? extends java.util.Map.Entry<K,V>> entries)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
-
-
-
Field Detail
-
INSTANCE
private static final ToMap<?,?,?> INSTANCE
-
-
Method Detail
-
checkedApply
public M checkedApply(Fn0<M> mFn0, java.lang.Iterable<? extends java.util.Map.Entry<K,V>> entries)
-
toMap
public static <K,V,M extends java.util.Map<K,V>> ToMap<K,V,M> toMap()
-
toMap
public static <K,V,M extends java.util.Map<K,V>> Fn1<java.lang.Iterable<? extends java.util.Map.Entry<K,V>>,M> toMap(Fn0<M> mFn0)
-
toMap
public static <K,V,M extends java.util.Map<K,V>> M toMap(Fn0<M> mFn0, java.lang.Iterable<? extends java.util.Map.Entry<K,V>> entries)
-
-