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
Nested ClassesModifier and TypeClassDescriptionstatic classWraps an entry, with optional type conversion. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Transformer<K, KW> protected final Transformer<V, VW> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransformMap(Map<KW, VW> wrapped, Transformer<K, KW> keyTransformer, Transformer<V, VW> valueTransformer) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction) computeIfPresent(K key, BiFunction<? super K, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanvoidforEach(BiConsumer<? super K, ? super V> action) getOrDefault(Object key, V defaultValue) inthashCode()booleanisEmpty()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.voidputIfAbsent(K key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super K, ? super V, ? extends V> function) intsize()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:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-
equals
-
hashCode
public int hashCode() -
getOrDefault
- Specified by:
getOrDefaultin interfaceMap<K,V>
-
forEach
-
replaceAll
- Specified by:
replaceAllin interfaceMap<K,V>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceMap<K,V>
-
remove
-
replace
-
replace
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceMap<K,V>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceMap<K,V>
-
compute
-
merge
-
