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>
-
- Type Parameters:
K
-V
-
- All Implemented Interfaces:
java.util.Map<K,V>
@XStreamConverter(com.funnelback.publicui.xml.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 Mapbut people are using Integer keys you can use this to convert the Integer key to a String key.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AutoConvertingMap.Converter<T>
Converter to convert from some other type to the expected type.
-
Field Summary
Fields Modifier and Type Field Description private AutoConvertingMap.Converter<K>
keyConverter
private static org.apache.logging.log4j.Logger
log
private java.lang.String
note
-
Constructor Summary
Constructors Constructor Description AutoConvertingMap(AutoConvertingMap.Converter<K> keyConverter, java.lang.String note, java.util.Map<K,V> underlyingMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object key)
private K
convertKey(K key)
V
get(java.lang.Object key)
V
put(K key, V value)
void
putAll(java.util.Map<? extends K,? extends V> m)
V
remove(java.lang.Object key)
-
Methods inherited from class com.funnelback.publicui.search.model.util.map.DelegateMap
clear, containsValue, entrySet, equals, getUnderlyingMap, hashCode, isEmpty, keySet, size, toString, values
-
-
-
-
Field Detail
-
log
private static final org.apache.logging.log4j.Logger log
-
keyConverter
private final AutoConvertingMap.Converter<K> keyConverter
-
note
private final java.lang.String note
-
-
Constructor Detail
-
AutoConvertingMap
public AutoConvertingMap(AutoConvertingMap.Converter<K> keyConverter, java.lang.String note, java.util.Map<K,V> underlyingMap)
-
-
Method Detail
-
get
public V get(java.lang.Object key)
-
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interfacejava.util.Map<K,V>
- Overrides:
containsKey
in classDelegateMap<K,V>
-
remove
public V remove(java.lang.Object key)
-
-