Package org.apache.commons.collections4
Class SplitMapUtils
- java.lang.Object
-
- org.apache.commons.collections4.SplitMapUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
IterableMap<K,V>readableMap(Get<K,V> get)
Get the specifiedGet
as an instance ofIterableMap
.static <K,V>
java.util.Map<K,V>writableMap(Put<K,V> put)
Get the specifiedPut
as an instanceofMap
.
-
-
-
Method Detail
-
readableMap
public static <K,V> IterableMap<K,V> readableMap(Get<K,V> get)
Get 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:
java.lang.NullPointerException
- if the argument is null
-
writableMap
public static <K,V> java.util.Map<K,V> writableMap(Put<K,V> put)
Get 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:
java.lang.NullPointerException
- if the argument is null
-
-