You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
603 B
Java
26 lines
603 B
Java
package com.engine.organization.common;
|
|
|
|
import java.util.HashMap;
|
|
|
|
/**
|
|
* @author:dxfeng
|
|
* @createTime: 2024/07/11
|
|
* @version: 1.0
|
|
*/
|
|
public class IgnoreCaseMap<V> extends HashMap<String, V> {
|
|
@Override
|
|
public V get(Object key) {
|
|
if (key instanceof String) {
|
|
// 将键转为小写形式再进行查找
|
|
return super.get(((String) key).toLowerCase());
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public V put(String key, V value) {
|
|
// 将键转为小写形式后作为真正的键
|
|
return super.put(key.toLowerCase(), value);
|
|
}
|
|
}
|