updated 8001667: Comparator combinators and extension methods (original) (raw)

Ali Ebrahimi ali.ebrahimi1781 at gmail.com
Wed Mar 6 20:20:58 UTC 2013


Hi, for me this is more readable than current naming.

Comparator cmp1 = compareWith(People::getFirstName). thenCompareWith(People::getLastName);

Ali Ebrahimi

On Thu, Mar 7, 2013 at 12:22 AM, Henry Jen <henry.jen at oracle.com> wrote:

On 03/06/2013 03:28 AM, Ali Ebrahimi wrote: > Hi, > just one suggestion: > > rename comparing with compareWith >

There was a round of discussion on naming.

http://mail.openjdk.java.net/pipermail/lambda-libs-spec-observers/2012-November/000446.html I have my personal preference among proposals, but EG seems to have come to a consensus on this. I don't feel strongly between thenCompare, thenComparing or thenCompareWith. But we should be consistent between Comparators and Comparator, and consider that Comparators methods could be static interface method on Comparator in the future. Cheers, Henry > 1) > > public static <T, U extends Comparable<? super U>> Comparator compareWith(Function<? super T, ? extends U> keyExtractor) { > > > 2) > default Comparator thenCompareWith(Comparator<? super T> other) > > > > Best Regards, > Ali Ebrahimi > On Wed, Mar 6, 2013 at 12:16 AM, Henry Jen <henry.jen at oracle.com_ _> <mailto:henry.jen at oracle.com>> wrote: > > Hi, > > Another update to reflect functional interface renames involved in the > API, and a bug fix for a regression found earlier. > > CCC had been approved. Can we get it reviewed and pushed? > > [1] http://cr.openjdk.java.net/~henryjen/ccc/8001667.4/webrev > > Cheers, > Henry > >



More information about the core-libs-dev mailing list