K - The 'key' typeV - The 'value' typepublic abstract class Mapping<K,V>
extends java.lang.Object
get(Object) is invoked. Consequently, in contrast with Map,
it has no specific size, and thus no Map.entrySet(), Map.keySet() and Map.values() set. Also
the modifying operations (Map.put(Object, Object), Map.putAll(Map), Map.remove(Object),
Map.clear()) are all missing, because a Mapping is not changed by 'putting' key-value-pairs into it.
Actually Map should extend Mapping, but it doesn't - thus there are the asMap() and
Mappings.fromMap(Map) helpers.
The relationship between Mapping and Map is very much like that between Predicate and
Collection.
| Constructor and Description |
|---|
Mapping() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<K,V> |
asMap()
|
abstract boolean |
containsKey(java.lang.Object key) |
abstract V |
get(java.lang.Object key) |