Bikeshed opportunity: compose vs composeWith

Brian Goetz brian.goetz at oracle.com
Thu Nov 29 08:18:27 PST 2012


> That would make my example read like this.
>
> TreeSet<Person> peopleByLastNameFirstNameAndAgeDesc = new TreeSet(comparing(Person::getLast).thenComparing(Person::getFirst).thenComparing(comparing(Person::getAge).reverse()));
>
> It feels like comparing is a bit overloaded to me.

It is.  Which is worse, the extra comparing() wrappers or the 
overloading?  I can go either way.

No matter how we slice this, it will be 1000x better than what you do 
today with inner classes...


More information about the lambda-libs-spec-observers mailing list