Module dagger

Class MapFactory<K,​V>

  • All Implemented Interfaces:
    Factory<java.util.Map<K,​V>>, jakarta.inject.Provider<java.util.Map<K,​V>>

    public final class MapFactory<K,​V>
    extends java.lang.Object
    A Factory implementation used to implement Map bindings. This factory returns a Map<K, V> when calling get() (as specified by Factory).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      MapFactory.Builder<K,​V>
      builder​(int size)
      Returns a new MapFactory.Builder
      static <K,​V>
      jakarta.inject.Provider<java.util.Map<K,​V>>
      emptyMapProvider()
      Returns a factory of an empty map.
      java.util.Map<K,​V> get()
      Returns a Map<K, V> whose iteration order is that of the elements given by each of the providers, which are invoked in the order given at creation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • emptyMapProvider

        public static <K,​V> jakarta.inject.Provider<java.util.Map<K,​V>> emptyMapProvider()
        Returns a factory of an empty map.
      • get

        public java.util.Map<K,​V> get()
        Returns a Map<K, V> whose iteration order is that of the elements given by each of the providers, which are invoked in the order given at creation.