#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:
@@ -42,7 +42,7 @@ public class Link implements Serializable {
|
||||
|
||||
public static final String REL_SELF = "self";
|
||||
public static final String REL_FIRST = "first";
|
||||
public static final String REL_PREVIOUS = "previous";
|
||||
public static final String REL_PREVIOUS = "prev";
|
||||
public static final String REL_NEXT = "next";
|
||||
public static final String REL_LAST = "last";
|
||||
|
||||
@@ -101,6 +101,25 @@ public class Link implements Serializable {
|
||||
return rel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Link} pointing to the same URI but with the given relation.
|
||||
*
|
||||
* @param rel must not be {@literal null} or empty.
|
||||
* @return
|
||||
*/
|
||||
public Link withRel(String rel) {
|
||||
return new Link(href, rel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@link Link} pointing to the same URI but with the {@code self} relation.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Link withSelfRel() {
|
||||
return withRel(Link.REL_SELF);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
|
||||
Reference in New Issue
Block a user