Back to project page octodroid.
The source code is released under:
MIT License
If you think the Android project octodroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.rejasupotaro.octodroid.http; //w w w . ja v a 2 s. c o m public class Pagination { private Link[] links = new Link[]{}; public boolean hasPrev() { return (getLinkByRel(Link.Rel.PREV) != null); } public boolean hasNext() { Link nextLink = getLinkByRel(Link.Rel.NEXT); return (nextLink != null) && (nextLink.getPage() > 0); } public boolean hasLast() { return (getLinkByRel(Link.Rel.LAST) != null); } public Link getFirstLink() { return getLinkByRel(Link.Rel.FIRST); } public Link getPrevLink() { return getLinkByRel(Link.Rel.PREV); } public Link getNextLink() { return getLinkByRel(Link.Rel.NEXT); } public Link getLastLink() { return getLinkByRel(Link.Rel.LAST); } private Link getLinkByRel(Link.Rel rel) { if (links == null) return null; for (Link link : links) { if (link.getRel() == rel) { return link; } } return null; } public Pagination() {} public Pagination(Link[] links) { this.links = links; } }