Skip to content

Release 2.0.0 Milestone 1

Pre-release
Pre-release
Compare
Choose a tag to compare
@gsteinacker gsteinacker released this 30 Nov 09:28
· 47 commits to master since this release

Breaking Changes

  • The error handling in the Traverson API has been changed in that exceptions are now thrown instead of catching them
    and exposing a Traverson.getLastError(). In 1.0.0, the client had to check for the last error. This is rather unusual
    and is easy to overlook. Beginning with 2.0.0, getLastError is removed and the following method-signatures are now
    throwing java.io.IOException:
    • Traverson.paginateNext()
    • Traverson.paginateNextAs()
    • Traverson.paginatePrev()
    • Traverson.paginatePrevAs()
    • Traverson.stream()
    • Traverson.streamAs()
    • Traverson.getResource()
    • Traverson.getResourceAs()
  • The static factory method Traverson.traverson() does not accept a java.util.function.Function<Link,String>
    anymore. Instead, a de.otto.edison.hal.traverson.LinkResolver was introduced. The major difference between the new
    PageHandler and the previous Function is that the PageHandler.apply(Link) is now throwing IOException while
    Function does not allow this.
  • For the same reasons (being able to throw IOExceptions), the different paginate* methods now expect a
    de.otto.edison.hal.traverson.PageHandler instead of a java.util.function.Function<Traverson,Boolean>. Beside of this,
    using dedicated functional interfaces instead of generic Functions is a little easier to understand.

New Features / API extensions

  • The Traverson now supports traversing linked resources while ignoring embedded resources: instead of returning an
    embedded item, clients are now able to force the Traverson to follow the links instead. This is especially helpful,
    if only a reduced set of attributes is embedded into a resource. A set of Traverson.followLink() methods was added
    to support this.
  • Added new methods Traverson.paginate() and Traverson.paginateAs() to paginate over paged resources using
    link-relation types other than next or prev.
  • Added a CuriTemplate helper to expand / shorten link-relation types using a CURI.