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)
| 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 | * |