/** * Factory method to create a lazily instantiated map. * * @param <K> the key type * @param <V> the value type * @param map the map to decorate, must not be null * @param factory the factory to use, must not be null * @return a new lazy map * @throws NullPointerException if map or factory is null * @since 4.0 */ public static <K, V> LazyMap<K, V> lazyMap(final Map<K, V> map, final Factory< ? extends V> factory) { return new LazyMap<>(map, factory); }
/** * Factory method to create a lazily instantiated map. * * @param <K> the key type * @param <V> the value type * @param map the map to decorate, must not be null * @param factory the factory to use, must not be null * @return a new lazy map * @throws NullPointerException if map or factory is null * @since 4.0 */ public static <V, K> LazyMap<K, V> lazyMap(final Map<K, V> map, final Transformer<? super K, ? extends V> factory) { return new LazyMap<>(map, factory); }