Package org.apache.commons.collections4
Class SplitMapUtils
java.lang.Object
org.apache.commons.collections4.SplitMapUtils
- Since:
- 4.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
SplitMapUtils
should not normally be instantiated. -
Method Summary
Modifier and TypeMethodDescriptionstatic <K,
V> IterableMap <K, V> readableMap
(Get<K, V> get) Get the specifiedGet
as an instance ofIterableMap
.static <K,
V> Map <K, V> writableMap
(Put<K, V> put)
-
Constructor Details
-
SplitMapUtils
private SplitMapUtils()SplitMapUtils
should not normally be instantiated.
-
-
Method Details
-
readableMap
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:
NullPointerException
- if the argument is null
-
writableMap
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:
NullPointerException
- if the argument is null
-