List<YourVO> list = ...; // 你的VO对象列表
String targetName = "tom";
int targetAge = 18;
OptionalInt index = IntStream.range(0, list.size())
.filter(i -> list.get(i).getName().equals(targetName) && list.get(i).getAge() == targetAge)
.findFirst();
05-24
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交