Class TransformMap<K,V,KW,VW>
java.lang.Object
com.aoapps.collections.transformers.TransformMap<K,V,KW,VW>
- All Implemented Interfaces:
Map<K,
V>
- Direct Known Subclasses:
TransformSortedMap
Wraps a
Map
, with optional type conversion.- Author:
- AO Industries, Inc.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Wraps an entry, with optional type conversion. -
Field Summary
Modifier and TypeFieldDescriptionprotected final Transformer
<K, KW> protected final Transformer
<V, VW> -
Constructor Summary
ModifierConstructorDescriptionprotected
TransformMap
(Map<KW, VW> wrapped, Transformer<K, KW> keyTransformer, Transformer<V, VW> valueTransformer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
computeIfAbsent
(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent
(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) boolean
containsKey
(Object key) boolean
containsValue
(Object value) entrySet()
boolean
void
forEach
(BiConsumer<? super K, ? super V> action) getOrDefault
(Object key, V defaultValue) int
hashCode()
boolean
isEmpty()
keySet()
static <K,
V> TransformMap <K, V, K, V> static <K,
V, KW, VW>
TransformMap<K, V, KW, VW> of
(Map<KW, VW> map, Transformer<K, KW> keyTransformer, Transformer<V, VW> valueTransformer) Wraps a map.void
putIfAbsent
(K key, V value) boolean
boolean
void
replaceAll
(BiFunction<? super K, ? super V, ? extends V> function) int
size()
values()
-
Field Details
-
keyTransformer
-
valueTransformer
-
-
Constructor Details
-
TransformMap
protected TransformMap(Map<KW, VW> wrapped, Transformer<K, KW> keyTransformer, Transformer<V, VW> valueTransformer)
-
-
Method Details
-
of
public static <K,V, TransformMap<K,KW, VW> V, ofKW, VW> (Map<KW, VW> map, Transformer<K, KW> keyTransformer, Transformer<V, VW> valueTransformer) Wraps a map.- If the given map is a
SortedMap
, then will return aTransformSortedMap
.
- See Also:
- If the given map is a
-
of
- See Also:
-
getWrapped
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
getOrDefault
- Specified by:
getOrDefault
in interfaceMap<K,
V>
-
forEach
-
replaceAll
- Specified by:
replaceAll
in interfaceMap<K,
V>
-
putIfAbsent
- Specified by:
putIfAbsent
in interfaceMap<K,
V>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsent
in interfaceMap<K,
V>
-
computeIfPresent
- Specified by:
computeIfPresent
in interfaceMap<K,
V>
-
compute
-
merge
-