删除list集合中某些数据

去除list集合中不符合条件的数据

List<DictVo> applyStateList = SingletonHoldResource.getInstance().getList(FrontConstant.APPLY_STATE);
        if (UserUtil.isCenterUser(user.getRoles())){
            //平台管理员
            //申请状态只有部门审批通过, 平台审批通过,平台审批不通过
            Iterator<DictVo> iterator = applyStateList.iterator();
            while(iterator.hasNext()){
                DictVo dictVo = iterator.next();
                if(FrontConstant.APPLY_STATE_NOT == Integer.parseInt(dictVo.getDictkey())){
                    iterator.remove();
                }
                if(FrontConstant.APPLY_STATE_DEPT_REFUSE == Integer.parseInt(dictVo.getDictkey())){
                    iterator.remove();
                }
                if(FrontConstant.APPLY_STATE_CLOSE == Integer.parseInt(dictVo.getDictkey())){
                    iterator.remove();
                }
            }
        }
原文地址:https://www.cnblogs.com/cailijuan/p/11833741.html