一年时间没有更新内容是因为忙着去考驾照和教师证去了,现在2个计划都完成了继续更新内容
//遍历缓存数据resultCache ,判断isOver是否等于1, 等于1就返回数据
public List<PageBean>getExceed(){
List<PageBean> list =new ArrayList<>();
Iterator<String> iterator = resultCache.keySet().iterator();
while (iterator.hasNext()){
String st = iterator.next();
// System.out.println("key值"+st+"value值::"+JSONObject.toJSONString(resultCache.get(st).getStationConfigs()));
Collection<StationConfig> stationConfigCollection = resultCache.get(st).getStationConfigs();
Iterator iterator1 = stationConfigCollection.iterator();
boolean flag = true;
while (iterator1.hasNext()){
StationConfig next = (StationConfig) iterator1.next();
if(flag){
//使用StringUtils.equals是因为这里有个判空操作,比直接使用string的equals更全面
if(StringUtils.equals("1",next.getIsOver())){
flag = false;
list.add(resultCache.get(st));
}
}
}
}
System.out.println("最后结果:::"+JSONObject.toJSONString(list));
return list ;
}
遍历Map 数据,返回List列表
最新推荐文章于 2023-12-14 09:05:07 发布
440

被折叠的 条评论
为什么被折叠?



