Buttink Buttink - 6 months ago 42
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?


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