2条回答 默认 最新
- D.Roy 2018-10-11 08:37关注
这个问题自己查阅 改造了下 搞定了 jsonArray 转成map类型的list 通过stream 判断key值 是否匹配 ture 则保留 false stream会通过filter过滤
List> mapListJson = (List)jsonArray;
List> mapListJson = (List)AllFiledheadlist;
for(int i=0;i Map map =mapListJson.get(i).entrySet().stream().filter((e) -> checkValue(e.getKey(),permisson_filed)).collect(Collectors.toMap((e) -> (String) e.getKey(), (e) -> e.getValue()));
fieldList.add(map);
}private static boolean checkValue(Object object,ArrayList permisson_filed){ System.out.println(object); if (permisson_filed.contains(object)) { return true; }else{ return false; } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报