K - The key type of the target instance.V - The value type of the target instance.M - The final type of the target instance, at least Map.S - The final type of the Setup implementation.@FunctionalInterface public static interface Mapping.Setup<K,V,M extends Map<K,V>,S extends Mapping.Setup<K,V,M,S>> extends Setup<M,S>
Map.| Modifier and Type | Method and Description |
|---|---|
default S |
clear()
Removes all pairs of key / value from the instance to be set up.
|
default S |
put(K key,
V value)
Puts a pair of key / value to the instance to be set up.
|
default S |
putAll(Map<? extends K,? extends V> origin)
Puts multiple pairs of key / value to the instance to be set up.
|
default S |
remove(Object key)
Removes a pair of a given key and its associated value from the instance to be set up.
|
default S put(K key, V value)
UnsupportedOperationException - if Map.put(Object, Object) is not supported by the instance
to be set up.NullPointerException - if the specified key or value is null
and the instance to be set up does not permit null
keys or valuesClassCastException - if the class of the specified key or value prevents
it from being put into the instance to be set up
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of the specified key or value
prevents it from being stored in the instance to be set up.Map.put(Object, Object),
Mapping.put(Map, Object, Object)default S remove(Object key)
Avoids an unnecessary ClassCastException or NullPointerException which might be caused by
Map.remove(Object) when the instance to be set up does not support the requested key.
UnsupportedOperationException - if Map.remove(Object) is not supported by the
subject.Map.remove(Object),
Mapping.remove(Map, Object)default S putAll(Map<? extends K,? extends V> origin)
If origin is null it will be treated as an empty Map.
UnsupportedOperationException - if Map.putAll(Map) is not supported
by the instance to be set up.NullPointerException - if any of the specified keys or values are
null and the instance to be set up does not permit
null keys or values.ClassCastException - if the class of any specified key or value prevents it
from being put into the subject
(may occur only if used raw or forced in a mismatched class context).IllegalArgumentException - if some property of any key or value in the specified
origin prevents it from being stored in the subject.Map.putAll(Map),
Mapping.putAll(Map, Map)default S clear()
UnsupportedOperationException - if Collection.clear() is not supported by the subject.Map.clear(),
Mapping.clear(Map)Copyright © 2023 Andreas Kluge-Kaindl, Bremen (de). All rights reserved.