org.apache.felix.bundlerepository.impl

## 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:
  java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>

    public class LazyHashMap<K,V>
    extends java.util.HashMap<K,V>
    implements java.util.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:
  Serialized Form

### Nested Class Summary

Nested Classes
`static class` `LazyHashMap.LazyValue<K,V>`

### Nested classes/interfaces inherited from class java.util.AbstractMap

`java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>`

### Nested classes/interfaces inherited from interface java.util.Map

`java.util.Map.Entry<K,V>`

### Constructor Summary

Constructors
Constructor and Description
`LazyHashMap(java.util.Collection<LazyHashMap.LazyValue<K,V>> lazyValues)` This map behaves like a normal HashMap, expect for the entries passed in as lazy values.

### Method Summary

Methods
`V` `get(java.lang.Object key)`
`V` `put(K key, V value)`

### Methods inherited from class java.util.HashMap

`clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, values`

### Methods inherited from class java.util.AbstractMap

`equals, hashCode, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Map

`clear, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values`

### Constructor Detail

#### LazyHashMap

    public LazyHashMap(java.util.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 Detail

#### get

    public V get(java.lang.Object key)

Specified by:
  `get` in interface `java.util.Map<K,V>`
Overrides:
  `get` in class `java.util.HashMap<K,V>`

#### put

    public V put(K key,
        V value)

Specified by:
  `put` in interface `java.util.Map<K,V>`
Overrides:
  `put` in class `java.util.HashMap<K,V>`