#64 - Extended support for PagedResources.

Changed Relation type to identify previous links to standardized value of prev. Added integration tests for HAL rendering of PagedResources.
This commit is contained in:
Oliver Gierke
2013-05-15 17:48:51 +02:00
parent 17d91aca55
commit a9ccfc6782
6 changed files with 203 additions and 3 deletions

View File

@@ -87,6 +87,16 @@ public class Links implements Iterable<Link> {
return result;
}
/**
* Returns whether the {@link Links} container contains a {@link Link} with the given rel.
*
* @param rel
* @return
*/
public boolean hasLink(String rel) {
return getLink(rel) != null;
}
/**
* Creates a {@link Links} instance from the given RFC5988-compatible link format.
*
@@ -114,6 +124,15 @@ public class Links implements Iterable<Link> {
return new Links(links);
}
/**
* Returns whether the {@link Links} containter is empty.
*
* @return
*/
public boolean isEmpty() {
return links.isEmpty();
}
/*
* (non-Javadoc)
* @see java.lang.Object#toString()