Class AutoConvertingMap<K,V>
- java.lang.Object
-
- com.funnelback.publicui.search.model.util.map.DelegateMap<K,V>
-
- com.funnelback.publicui.search.model.util.map.AutoConvertingMap<K,V>
-
- All Implemented Interfaces:
Map<K,V>
@XStreamConverter(AutoConvertingMapXStreamConverter.class) public class AutoConvertingMap<K,V> extends DelegateMap<K,V>
A map that can auto convert the key from one type to the expected type.
For example, if you have a map that is
Map\
but people are using Integer keys you can use this to convert the Integer key to a String key.
-
-
Field Summary
Fields Modifier and Type Field Description private AutoConvertingMap.Converter<K>
keyConverter
private String
note
-
Constructor Summary
Constructors Constructor Description AutoConvertingMap(AutoConvertingMap.Converter<K> keyConverter, String note, Map<K,V> underlyingMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(Object key)
private K
convertKey(K key)
V
get(Object key)
V
put(K key, V value)
void
putAll(Map<? extends K,? extends V> m)
V
remove(Object key)
-
Methods inherited from class com.funnelback.publicui.search.model.util.map.DelegateMap
clear, containsValue, entrySet, equals, hashCode, isEmpty, keySet, size, toString, values
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
keyConverter
private final AutoConvertingMap.Converter<K> keyConverter
-
note
private final String note
-
-