Bean1和Bean2 都含有playerId属性

List<Bean1> intersectList = list1.stream()
                        .filter(pe -> find1(pe.getPlayerId(), list2) > -1).collect(Collectors.toList());

辅助方法find1

public int find1(long playerId,List<PlayerExtra> list) {
        int res = -1;
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getPlayerId() == playerId) {
                res = i;
                break;
            }
        }
        return res;
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
相关资源
相似解决方案