Fluent Java library for collections: op4j

op4j is a nice little library for all those of us who need to work with collections. Here is a little example:

  Calendar now = Calendar.getInstance();
  Set<Calendar> set = 
      Op.on(list)
      .toSet()
      .map(FnString.toCalendar("dd/MM/yyyy"))
      .removeAllNullOrTrue(FnCalendar.after(now))
      .get();

That takes a list of strings, converts them to Calendar instances and removes all dates which are null or in the future. Questions?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: