
org.tango.utils.CaseInsensitiveMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JTangoCommons Show documentation
Show all versions of JTangoCommons Show documentation
Common classes for tango java API
package org.tango.utils;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@SuppressWarnings("serial")
public class CaseInsensitiveMap extends HashMap {
public CaseInsensitiveMap() {
super();
}
public CaseInsensitiveMap(final Map map) {
super(map);
}
public CaseInsensitiveMap(final int size) {
super(size);
}
@Override
public V put(final String key, final V value) {
return super.put(key.toLowerCase(Locale.ENGLISH), value);
}
@Override
public V get(final Object key) {
return super.get(((String) key).toLowerCase());
}
@Override
public void putAll(final Map extends String, ? extends V> m) {
for (final Map.Entry extends String, ? extends V> entry : m.entrySet()) {
super.put(entry.getKey().toLowerCase(Locale.ENGLISH), entry.getValue());
}
}
@Override
public V remove(final Object key) {
return super.remove(((String) key).toLowerCase());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy