Class LazyMap<KeyType,ValueType>
java.lang.Object
net.shibboleth.utilities.java.support.collection.LazyMap<KeyType,ValueType>
- Type Parameters:
KeyType
- the type of the map keysValueType
- 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
-
Field Summary
Fields Modifier and Type Field Description private Map<KeyType,ValueType>
delegate
The delegate map.private static 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 serialVersionUIDSerial version UID.- See Also:
- Constant Field Values
-
delegate
The delegate map.
-
-
Constructor Details
-
LazyMap
public LazyMap()
-
-
Method Details
-
clear
public void clear() -
containsKey
- Specified by:
containsKey
in interfaceMap<KeyType,ValueType>
-
containsValue
- Specified by:
containsValue
in interfaceMap<KeyType,ValueType>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-
buildMap
Builds an appropriate delegate map.- Returns:
- the delegate map
-
toString
-
hashCode
public int hashCode() -
equals
-