Skip to content

Version 2.1.0

Choose a tag to compare

@brianburton brianburton released this 11 Nov 23:00
· 635 commits to master since this release

This version focuses on usability improvements in the API.

New features in this release:

  • Adds new lambda friendly methods to IterableStreamable (base interface for all collections as well as views returned by methods such as keys(), entries(), and values().
    • count(): Returns total number of elements.
    • count(p): Returns total number of elements for which Predicate p returns true.
    • allMatch(p): Returns true if Predicate p returns true for all elements.
    • anyMatch(p): Returns true if Predicate p returns true for any element.
    • first(p): Returns Holder containing first element for which Predicate p returns true, otherwise returns empty Holder.
    • collect(c): Adds all elements to Insertable c.
    • collect(n,c): Adds first nelements to Insertablec`.
    • collect(c,p): Adds all elements for which Predicate p returns true to Insertable c.
    • collect(n,c,p): Adds first n elements for which Predicate p returns true to Insertable c.
    • transform(c,t): Adds result of calling Func1 t for every element to Insertable c.
    • transform(n,c,t): Adds result of calling Func1 t for first n elements to Insertable c.
    • transformSome(c,t): Same as transform(c,t) except t returns a Holder and only the contents of non-empty Holders are added to c.
    • transformSome(n,c,t): Same as transform(n,c,t) except t returns a Holder and only the contents of non-empty Holders are added to c.
    • partition(m,u,p): Adds every element to either m or u. All elements for which p returns true are added to m and all others are added to u.
    • reduce(f): Calls f for every element and returns final result.
  • Fixes insertAll() methods that previously returned Insertable instead of the class the method belonged to.
  • Adds more insertAll() variants to Insertable.
  • Refactors multi-value methods like insertAll(), deleteAll(), etc to use Iterable instead of Cursorable. Variants taking Cursor are still provided but the refactoring allows the library to default to using lower overhead Iterators instead.
  • Adds select() and reject() methods to JImmutableSet working the same way as those on JImmutableList.