Class LazyHashMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
org.apache.felix.bundlerepository.impl.LazyHashMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,V>

public class LazyHashMap<K,V> extends HashMap<K,V> implements Map<K,V>
A map that can delay the computation of certain values up until the moment that they are actually needed. Useful for expensive to compute values such as the SHA-256. This map does not support null values.
See Also:
  • Constructor Details

    • LazyHashMap

      public LazyHashMap(Collection<LazyHashMap.LazyValue<K,V>> lazyValues)
      This map behaves like a normal HashMap, expect for the entries passed in as lazy values. A lazy value is a Callable object associated with a key. When the key is looked up and it's one of the lazy values, the value will be computed at that point and stored in the map. If the value is looked up again, it will be served from the map as usual.
      Parameters:
      lazyValues -
  • Method Details