Package com.palantir.util.paging
Class SimpleResultsPage<T>
- java.lang.Object
-
- com.palantir.util.paging.SimpleResultsPage<T>
-
- Type Parameters:
T
- the type of item being paged
- All Implemented Interfaces:
BasicResultsPage<T>
,Serializable
- Direct Known Subclasses:
SimpleTokenBackedResultsPage
@Immutable public class SimpleResultsPage<T> extends Object implements BasicResultsPage<T>, Serializable
Supplies a simple result page.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleResultsPage(Iterable<T> chunks)
Constructs a page of iterable chunks.SimpleResultsPage(Iterable<T> chunks, boolean moreAvailable)
Constructs a page of iterable chunks of results.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> SimpleResultsPage<T>
create(Iterable<T> chunks)
static <T> SimpleResultsPage<T>
create(Iterable<T> chunks, boolean moreAvailable)
static <T> SimpleResultsPage<T>
emptyPage()
Constructs an empty results page.boolean
equals(Object obj)
com.google.common.collect.ImmutableList<T>
getResults()
Returns the results in the current page.int
hashCode()
boolean
moreResultsAvailable()
Identifies if more results are available.String
toString()
-
-
-
Method Detail
-
emptyPage
public static <T> SimpleResultsPage<T> emptyPage()
Constructs an empty results page.- Type Parameters:
T
- the type of result- Returns:
- a page
-
create
public static <T> SimpleResultsPage<T> create(Iterable<T> chunks)
-
create
public static <T> SimpleResultsPage<T> create(Iterable<T> chunks, boolean moreAvailable)
-
getResults
public com.google.common.collect.ImmutableList<T> getResults()
Description copied from interface:BasicResultsPage
Returns the results in the current page.- Specified by:
getResults
in interfaceBasicResultsPage<T>
- Returns:
- list of results
-
moreResultsAvailable
public boolean moreResultsAvailable()
Description copied from interface:BasicResultsPage
Identifies if more results are available.- Specified by:
moreResultsAvailable
in interfaceBasicResultsPage<T>
- Returns:
- true if there are more pages, otherwise false
-
-