jOOQ / jOOL

jOOλ - The Missing Parts in Java 8 jOOλ improves the JDK libraries in areas where the Expert Group's focus was elsewhere. It adds tuple support, function support, and a lot of additional functionality around sequential Streams. The JDK 8's main efforts (default methods, lambdas, and the Stream API) were focused around maintaining backwards compatibility and implementing a functional API for parallelism.
http://www.jooq.org/products
Apache License 2.0
2.09k stars 168 forks source link

Reject method to Seq stream #346

Closed strogiyotec closed 5 years ago

strogiyotec commented 5 years ago

It would be good if JOOL will have an analog of Ruby's reject method which is opposite to filter method (remove element if matched)

lukaseder commented 5 years ago

You can simply write Seq.filter(Predicate.not(mypredicate)).

strogiyotec commented 5 years ago

In my opinion

Seq.of(1,2,3,4,5).reject(p->p>2)

is more clear . What do you think ?

lukaseder commented 5 years ago

What's unclear about this?

Seq.of(1,2,3,4,5).filter(p->p<=2)