Class SamplePage
java.lang.Object
com.codename1.health.SamplePage
One page of samples, plus the token needed to fetch the next.
String token = null;
do {
SamplePage page = store.readSamplePage(query.setPageToken(token)).get();
process(page.getSamples());
token = page.getNextPageToken();
} while (token != null);
-
Constructor Summary
ConstructorsConstructorDescriptionSamplePage(List<HealthSample> samples, String nextPageToken, boolean truncated) Creates a page. -
Method Summary
Modifier and TypeMethodDescriptionThe token that fetches the following page, or null when this is the last one.The samples in this page, never null.booleanisEmpty()truewhen this page holds no samples.booleantruewhen the query's limit cut the result short and more data matched than was returned.intsize()How many samples this page holds.toString()Returns a string representation of the object.
-
Constructor Details
-
SamplePage
Creates a page. The sample list is copied defensively.
-
-
Method Details
-
getSamples
The samples in this page, never null. -
getNextPageToken
The token that fetches the following page, or null when this is the last one. Pass it toSampleQuery.setPageToken(String). -
isTruncated
public boolean isTruncated()truewhen the query's limit cut the result short and more data matched than was returned.Distinct from having a next-page token: a page can be the last one and still be truncated, which means the store stopped early rather than running out of data. Worth surfacing rather than quietly showing a partial total.
-
size
public int size()How many samples this page holds. -
isEmpty
public boolean isEmpty()truewhen this page holds no samples. -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-