Package com.jcabi.github
Class RtPagination<T>
- java.lang.Object
-
- com.jcabi.github.RtPagination<T>
-
- Type Parameters:
T
- Type of iterable objects
- All Implemented Interfaces:
Iterable<T>
@Immutable public final class RtPagination<T> extends Object implements Iterable<T>
Github pagination.This class is a convenient iterator over multiple JSON objects returned by Github API. For example, to iterate through notifications (see Notifications API) you can use this code:
Iterable<JsonObject> notifications = new RtPagination<>( new RtGithub(oauth).entry() .uri().path("/notifications").back(), RtPagination.COPYING );
- Since:
- 0.4, 0.11
- Version:
- $Id: a000f5d5b0fc606725b46c427340a4010d614413 $
- Author:
- Yegor Bugayenko (yegor256@gmail.com)
- See Also:
- Pagination
-
-
Field Summary
Fields Modifier and Type Field Description static RtValuePagination.Mapping<javax.json.JsonObject,javax.json.JsonObject>
COPYING
Mapping that just copies JsonObject.
-
Constructor Summary
Constructors Constructor Description RtPagination(com.jcabi.http.Request req, RtValuePagination.Mapping<T,javax.json.JsonObject> mpp)
Public ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterator<T>
iterator()
RtValuePagination.Mapping<T,javax.json.JsonObject>
mapping()
Mapping.com.jcabi.http.Request
request()
Entry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
COPYING
public static final RtValuePagination.Mapping<javax.json.JsonObject,javax.json.JsonObject> COPYING
Mapping that just copies JsonObject.- Suppressed Checkstyle violations:
- LineLength (3 lines)
-
-
Constructor Detail
-
RtPagination
public RtPagination(com.jcabi.http.Request req, RtValuePagination.Mapping<T,javax.json.JsonObject> mpp)
Public ctor.- Parameters:
req
- Requestmpp
- Mapping
-
-