All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hutool.core.map.CaseInsensitiveTreeMap Maven / Gradle / Ivy

There is a newer version: 5.8.33
Show newest version
package cn.hutool.core.map;

import java.util.Comparator;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * 忽略大小写的{@link TreeMap}
* 对KEY忽略大小写,get("Value")和get("value")获得的值相同,put进入的值也会被覆盖 * * @author Looly * * @param 键类型 * @param 值类型 * @since 3.3.1 */ public class CaseInsensitiveTreeMap extends CaseInsensitiveMap { private static final long serialVersionUID = 4043263744224569870L; // ------------------------------------------------------------------------- Constructor start /** * 构造 */ public CaseInsensitiveTreeMap() { this((Comparator) null); } /** * 构造 * * @param m Map * @since 3.1.2 */ public CaseInsensitiveTreeMap(Map m) { this(); this.putAll(m); } /** * 构造 * * @param m Map,初始Map,键值对会被复制到新的TreeMap中 * @since 3.1.2 */ public CaseInsensitiveTreeMap(SortedMap m) { super(new TreeMap(m)); } /** * 构造 * * @param comparator 比较器,{@code null}表示使用默认比较器 */ public CaseInsensitiveTreeMap(Comparator comparator) { super(new TreeMap<>(comparator)); } // ------------------------------------------------------------------------- Constructor end }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy