Package org.opendaylight.yangtools.util
Class UnmodifiableMap<K,V>
java.lang.Object
org.opendaylight.yangtools.util.UnmodifiableMap<K,V>
- Type Parameters:
K
- the type of keys maintained by this mapV
- the type of mapped values
An unmodifiable view over a
Map
. Unlike the view returned via Collections.unmodifiableMap(Map)
, this
class checks its argument to ensure multiple encapsulation does not occur.
This class checks the argument so it prevents multiple encapsulation. Subclasses of
ImmutableMap
are also recognized and not encapsulated.
-
Nested Class Summary
-
Method Summary
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
-
Method Details
-
of
Create an unmodifiable view of the targetMap
. If the map is known to be unmodifiable, that same instance is returned. Otherwise an unmodifiable view of the map will be returned.- Parameters:
map
- Target map- Returns:
- An unmodifiable view of the map
- Throws:
NullPointerException
- ifmap
is null
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
keySet
-
values
-
entrySet
-
hashCode
public int hashCode() -
equals
-
toString
-
put
-
remove
-
putAll
-
clear
public void clear()
-