Class ToMap<K,​V,​M extends java.util.Map<K,​V>>

  • Type Parameters:
    K - the key element type
    V - the value element type
    M - 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 an Fn0 of some Map M, create an instance of M and put all of the entries in the provided Iterable into the instance. Note that instances of M must support Map.put(K, V) (which is to say, must not throw on invocation).
    • Field Detail

      • INSTANCE

        private static final ToMap<?,​?,​?> INSTANCE
    • Constructor Detail

      • ToMap

        private ToMap()
    • Method Detail

      • checkedApply

        public M checkedApply​(Fn0<M> mFn0,
                              java.lang.Iterable<? extends java.util.Map.Entry<K,​V>> entries)
        Specified by:
        checkedApply in interface Fn2<K,​V,​M extends java.util.Map<K,​V>>
      • 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)