布尔供应商 Java 等待条件为 true
我试图等待,直到 areHere 列表中存在条件(我正在等待的那个)。我正在尝试与 BooleanSupplier 合作,但无法让它工作,不确定我的错误在哪里:
String theOne = "pika";
final BooleanSupplier itsHere = () -> {
List <String> areHere = getSomeList();
for (String eachOne : areHere) {
if(eachOne.equals(theOne)) { return TRUE; }
} return FALSE;
};
I am trying to get to wait until there exists the condition (theOne, that I am waiting for) in the list of areHere. I am trying to work with BooleanSupplier but can't get it to work, not sure where is my mistake:
String theOne = "pika";
final BooleanSupplier itsHere = () -> {
List <String> areHere = getSomeList();
for (String eachOne : areHere) {
if(eachOne.equals(theOne)) { return TRUE; }
} return FALSE;
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你需要执行供应商。您刚刚声明了供应商。但没有被执行。
you need to execute supplier. You just declared supplier. But not executed.