第七节 使用HuTool工具操作Map

亮子 2023-11-25 14:47:15 20551 0 0 0
  @GetMapping("/mapUtil")
    public CommonResult mapUtil(){
        //将多个键值对加入到Map中
        Map<Object, Object> map = MapUtil.of(new String[][]{
                {"key1", "value1"},
                {"key2", "value2"},
                {"key3", "value3"},
        });

        //判断Map是否为空?
        MapUtil.isEmpty(map);
        MapUtil.isNotEmpty(map);
        return CommonResult.success(null,"操作成功!");
    }