Sort set of Strings?

23 views
Skip to first unread message

Dmitriy Vsekhvalnov

unread,
May 31, 2012, 6:06:54 AM5/31/12
to lam...@googlegroups.com
Hi all,

  probably missing obvious point here, but how can i sort LambdaSet<String> with fluent collections?

E.g.:

                with(pointOfSales)
                    .extract(on(POS.class).getCity())
                    .convert(trim())
                    .distinct()
                    .sort();   //Missing no-arg sort for String.class

Mario Fusco

unread,
May 31, 2012, 6:29:49 AM5/31/12
to lam...@googlegroups.com
Good point: I didn't think to also provide in the fluent collections a simple sort on the natural order of the items in the list. I will add it for sure in the next release.

The only (only) thing you could do at the moment is using the Collections.sort java method like in:

Collections.sort( with(pointOfSales).extract(on(POS.class).getCity()). ... )

Thanks for pointing this out.
Mario
Reply all
Reply to author
Forward
0 new messages