MCPcopy Create free account
hub / github.com/Teneted/Tenet / newAutoMap

Method newAutoMap

src/main/java/co/aikar/util/LoadingMap.java:92–95  ·  view source on GitHub ↗

Creates a LoadingMap with an auto instantiating loader. Will auto construct class of of Value when not found Since this uses Reflection, It is more effecient to define your own static loader than using this helper, but if performance is not critical, this is easier. @param backingMap Actual map b

(Map<K, V> backingMap, final Class<? extends K> keyClass,
                                              final Class<? extends V> valueClass)

Source from the content-addressed store, hash-verified

90 * @return Map that auto instantiates on .get()
91 */
92 public static <K, V> Map<K, V> newAutoMap(Map<K, V> backingMap, final Class<? extends K> keyClass,
93 final Class<? extends V> valueClass) {
94 return new LoadingMap<>(backingMap, new AutoInstantiatingLoader<>(keyClass, valueClass));
95 }
96 /**
97 * Creates a LoadingMap with an auto instantiating loader.
98 *

Callers 1

newHashAutoMapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected