Package org.apache.commons.collections4
Class SplitMapUtils
java.lang.Object
org.apache.commons.collections4.SplitMapUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> IterableMap<K, V> readableMap
(Get<K, V> get) Gets the specifiedGet
as an instance ofIterableMap
.static <K,
V> Map<K, V> writableMap
(Put<K, V> put)
-
Method Details
-
readableMap
Gets the specifiedGet
as an instance ofIterableMap
. Ifget
implementsIterableMap
directly, no conversion will take place. Ifget
implementsMap
but notIterableMap
it will be decorated. Otherwise, anUnmodifiable
IterableMap
will be returned.- Type Parameters:
K
- the key typeV
- the value type- Parameters:
get
- to wrap, must not be null- Returns:
IterableMap
- Throws:
NullPointerException
- if the argument is null
-
writableMap
Gets the specifiedPut
as an instanceofMap
. Ifput
implementsMap
directly, no conversion will take place. Otherwise, a write-onlyMap
will be returned. On such aMap
it is recommended that the result of #put(K, V) be discarded as it likely will not matchV
at runtime.- Type Parameters:
K
- the key typeV
- the element type- Parameters:
put
- to wrap, must not be null- Returns:
Map
- Throws:
NullPointerException
- if the argument is null
-