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

Fix #352 #384

Closed awnofwheat closed 3 years ago

awnofwheat commented 3 years ago

I create a new constructer to create tuple2 so that we can choose whether to swap bounds by default.

lukaseder commented 3 years ago

Thanks for your suggestion.

While I appreciate the idea of being able to occasionally swap elements of a Tuple2, that functionality could (if at all) be implemented simply by a Tuple2<T1, T2>.swapAttributes(): Tuple2<T2, T1> method. For the record, I don't think this utility pulls its weight, so I wouldn't want an alternative PR in this case.

We can't retain a swap flag in the Tuple2 type. A Tuple2 doesn't care about the fact that its creator may have meant for the attributes to be swapped.

For the future, please discuss your ideas first before providing a PR.