1 package com.atlassian.marketplace.client.api;
2
3 import java.io.InputStream;
4
5 import com.atlassian.marketplace.client.MpacException;
6
7 /**
8 * Used internally in {@link Page} to keep track of how to get additional pages of a result set. You should
9 * not need to refer to this class directly.
10 * @since 2.0.0
11 */
12 public abstract class PageReader<T>
13 {
14 public abstract Page<T> readPage(PageReference<T> ref, InputStream in) throws MpacException;
15
16 public static <T> PageReader<T> stub()
17 {
18 return new PageReader<T>()
19 {
20 public Page<T> readPage(PageReference<T> ref, InputStream in)
21 {
22 return Page.empty();
23 }
24 };
25 }
26 }