快速新建和初始化HashMap
依赖:
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.8.27</version>
</dependency>
示例:
import cn.hutool.core.map.MapUtil;
Map<String, String> map = MapUtil.ofEntries(MapUtil.entry("key1", "value1"), MapUtil.entry("key2", "value2"));