java map entrySet() 应用()

java map entrySet() 应用:

    public boolean hasPermission(Map<String, Object> map){
        boolean flag = false;
        if(StringHelper.IsEmptyOrNull(map.get("ORGROLELIST"))){
            return flag;
        }
        List<Map<String, Object>> listMap = (List<Map<String, Object>>) map.get("ORGROLELIST");
        for (Map<String, Object> roleMap : listMap) {
            for (Map.Entry<String, Object> entry : roleMap.entrySet()) {
                if ((map.get("ORG_ID").toString()).equals(entry.getKey().toString())) {
                    flag = true;
                    return flag;
                }
            }
        }
        return flag;
    }
————————

java map entrySet() 应用:

    public boolean hasPermission(Map<String, Object> map){
        boolean flag = false;
        if(StringHelper.IsEmptyOrNull(map.get("ORGROLELIST"))){
            return flag;
        }
        List<Map<String, Object>> listMap = (List<Map<String, Object>>) map.get("ORGROLELIST");
        for (Map<String, Object> roleMap : listMap) {
            for (Map.Entry<String, Object> entry : roleMap.entrySet()) {
                if ((map.get("ORG_ID").toString()).equals(entry.getKey().toString())) {
                    flag = true;
                    return flag;
                }
            }
        }
        return flag;
    }