-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Predicate<Tuple[N]<T...>> Tuple.predicate(Predicate[N]<T...>) #391
Comments
Thanks a lot for your suggestion. I can see how this could help in your example, though it's not strictly necessary. You can always just These I would need a few more applications than this convenience to justify adding another 16 interfaces. |
I see your point What about an implementation that does not require any Predicate<Tuple0> Tuple.predicate(Function0<Boolean>)
Predicate<Tuple1<T1>> Tuple.predicate(Function1<T1, Boolean>)
Predicate<Tuple2<T1, T2>> Tuple.predicate(Function2<T1, T2, Boolean>)
...
Predicate<Tuple[N]<T...>> Tuple.predicate(Function[N]<T..., Boolean>) |
I had thought of it. A |
You are right |
Well, we might get |
…<T...>) In order to beautify stream processing like that: Seq.of(tuple("marco", 24), tuple("luigi", 16), tuple("maria", 18)) .filter(Tuple.predicate((name, age) -> age > 17)) .map(Tuple.function((name, age) -> tuple("Sir / Madame " + name, age))) .forEach(Tuple.consumer((name, age) -> process(options, name, age)));
I re-propose attention to an old issue that has not yet been fully solved: #214
Currently jOOL offers:
But it misses:
In order to beautify stream processing like that:
The text was updated successfully, but these errors were encountered: