Class 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 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 - Request
        mpp - Mapping
    • Method Detail

      • request

        public com.jcabi.http.Request request()
        Entry.
        Returns:
        Entry point