Buttink Buttink - 1 year ago 79
Java Question

How to tell that any object in a observable satisfies a condition?

I have looked and it seems like there is an "All" operation that will tell if all items satisfy a condition but no "Any" is this just an oversight or am I missing something? I could recreate it with other operations, but I could say the same thing with All.

.filter(i -> i < 7)
.reduce((c,n) -> c && n) // or "||" for any
.subscribe(b -> /* do stuff */);

Am I missing something or is there really just no Any?

Answer Source

It was named exists in 1.x (and is again any in 2.x).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download