Readability

Mark Thornton mthornton at optrak.co.uk
Wed Dec 22 10:24:30 PST 2010


On 22/12/2010 17:59, Llewellyn Falco wrote:
> Here that is using the current proposed 1.8
>
>
> List<String>  sorted = Query.orderBy(Query.where(Query.select(people,
> #{p->p.getFirstName()}), #{p->  p.length()<  10)), #{p->p.length});
>

You might conceivably write something like this

List<String> sorted = new Query(people)
     .select(#{p->p.getFirstName()})
     .where(#{p-> p.length() < 10})
     .orderBy(#{p->p.length()})
     .execute();

instead without need of extension methods.

Mark



More information about the lambda-dev mailing list