Sorting and comparator (original) (raw)
Greg Dennis gdennis at alum.mit.edu
Thu Nov 22 06:46:29 PST 2012
- Previous message: Primitive streams and optional
- Next message: No-reuse-streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Currently the idiom to sort a stream of Person by name is to call: people.sorted(Comparators.comparing(Person::getName))
If this idiom is stuck with, maybe "comparing" could be renamed to "by". With a static import, this could read nicely: people.sorted(by(Person::getName))
Greg
- Previous message: Primitive streams and optional
- Next message: No-reuse-streams
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the lambda-libs-spec-observers mailing list