Class LazyLoadingMap<K,T>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,T>
org.apache.sling.graphql.helpers.lazyloading.LazyLoadingMap<K,T>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,T>

public class LazyLoadingMap<K,T> extends HashMap<K,T>
A HashMap that optionally uses Suppliers to provide its values. Each Supplier is called at most once, if the corresponding value is requested. Some "global" operations requires all values to be computed, and should be considered costly. Like HashMap, this class is NOT thread safe. If needed, Collections.synchronizedMap(java.util.Map<K, V>) can be used to synchronize it. Note that remove(java.lang.Object) behaves slightly differently than the HashMap version.
See Also: