Bikeshed opportunity: compose vs composeWith (original) (raw)
Raab, Donald Donald.Raab at gs.com
Thu Nov 29 08:12:45 PST 2012
- Previous message: Bikeshed opportunity: compose vs composeWith
- Next message: Bikeshed opportunity: compose vs composeWith
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm OK with thenComparing taking comparator and having convenience methods to take a Function too:
default Comparator thenComparing(IntFunction f) { return thenComparing(comparing(f)); }
That would make my example read like this.
TreeSet peopleByLastNameFirstNameAndAgeDesc = new TreeSet(comparing(Person::getLast).thenComparing(Person::getFirst).thenComparing(comparing(Person::getAge).reverse()));
It feels like comparing is a bit overloaded to me.
- Previous message: Bikeshed opportunity: compose vs composeWith
- Next message: Bikeshed opportunity: compose vs composeWith
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list