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);
    }
}
