Package net.shibboleth.shared.collection

# Class LazyMap<KeyType,ValueType>

java.lang.Object
net.shibboleth.shared.collection.LazyMap<KeyType,ValueType>

Type Parameters:
  `KeyType` - the type of the map keys
  `ValueType` - the type of the map values

All Implemented Interfaces:
  `Serializable`, `Map<KeyType,ValueType>`

@NotThreadSafe public class LazyMap<KeyType,ValueType> extends Object implements Map<KeyType,ValueType>, Serializable
A map that is lazy initialized. This map takes very little memory when storing zero or one item.

See Also:
  - Serialized Form

## Nested Class Summary

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

`Map.Entry<K extends Object,V extends Object>`

## Field Summary

Fields
Modifier and Type
Field
Description
`private Map<KeyType,ValueType>`
`delegate`
The delegate map.
`private static final long`
`serialVersionUID`
Serial version UID.

## Constructor Summary

Constructors
Constructor
Description
`LazyMap()`

## Method Summary

Modifier and Type
Method
Description
`protected Map<KeyType,ValueType>`
`buildMap()`
Builds an appropriate delegate map.
`void`
`clear()`
`boolean`
`containsKey(Object key)`
`boolean`
`containsValue(Object value)`
`Set<Map.Entry<KeyType,ValueType>>`
`entrySet()`
`boolean`
`equals(Object obj)`
`ValueType`
`get(Object key)`
`int`
`hashCode()`
`boolean`
`isEmpty()`
`Set<KeyType>`
`keySet()`
`ValueType`
`put(KeyType key, ValueType value)`
`void`
`putAll(Map<? extends KeyType,? extends ValueType> t)`
`ValueType`
`remove(Object key)`
`int`
`size()`
`String`
`toString()`
`Collection<ValueType>`
`values()`

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

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

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

`compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

## Field Details

### serialVersionUID

private static final long serialVersionUID
Serial version UID.

See Also:
  - Constant Field Values

### delegate

@Nonnull private Map<KeyType,ValueType> delegate
The delegate map.

## Constructor Details

### LazyMap

public LazyMap()

## Method Details

### clear

public void clear()

Specified by:
  `clear` in interface `Map<KeyType,ValueType>`

### containsKey

public boolean containsKey(Object key)

Specified by:
  `containsKey` in interface `Map<KeyType,ValueType>`

### containsValue

public boolean containsValue(Object value)

Specified by:
  `containsValue` in interface `Map<KeyType,ValueType>`

### entrySet

public Set<Map.Entry<KeyType,ValueType>> entrySet()

Specified by:
  `entrySet` in interface `Map<KeyType,ValueType>`

### get

public ValueType get(Object key)

Specified by:
  `get` in interface `Map<KeyType,ValueType>`

### isEmpty

public boolean isEmpty()

Specified by:
  `isEmpty` in interface `Map<KeyType,ValueType>`

### keySet

public Set<KeyType> keySet()

Specified by:
  `keySet` in interface `Map<KeyType,ValueType>`

### put

public ValueType put(KeyType key, ValueType value)

Specified by:
  `put` in interface `Map<KeyType,ValueType>`

### putAll

public void putAll(Map<? extends KeyType,? extends ValueType> t)

Specified by:
  `putAll` in interface `Map<KeyType,ValueType>`

### remove

public ValueType remove(Object key)

Specified by:
  `remove` in interface `Map<KeyType,ValueType>`

### size

public int size()

Specified by:
  `size` in interface `Map<KeyType,ValueType>`

### values

public Collection<ValueType> values()

Specified by:
  `values` in interface `Map<KeyType,ValueType>`

### buildMap

@Nonnull protected Map<KeyType,ValueType> buildMap()
Builds an appropriate delegate map.

Returns:
  the delegate map

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### hashCode

public int hashCode()

Specified by:
  `hashCode` in interface `Map<KeyType,ValueType>`
Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Specified by:
  `equals` in interface `Map<KeyType,ValueType>`
Overrides:
  `equals` in class `Object`