Release 2.0.0 Milestone 1
Pre-release
Pre-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 aTraverson.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
throwingjava.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 ajava.util.function.Function<Link,String>
anymore. Instead, ade.otto.edison.hal.traverson.LinkResolver
was introduced. The major difference between the new
PageHandler
and the previousFunction
is that thePageHandler.apply(Link)
is now throwingIOException
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 ajava.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 theTraverson
to follow the links instead. This is especially helpful,
if only a reduced set of attributes is embedded into a resource. A set ofTraverson.followLink()
methods was added
to support this. - Added new methods
Traverson.paginate()
andTraverson.paginateAs()
to paginate over paged resources using
link-relation types other thannext
orprev
. - Added a
CuriTemplate
helper to expand / shorten link-relation types using a CURI.