Package com.twilio.base
Class Page<T>
- java.lang.Object
-
- com.twilio.base.Page<T>
-
public class Page<T> extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Page<T>
fromJson(String recordKey, String json, Class<T> recordType, com.fasterxml.jackson.databind.ObjectMapper mapper)
Create a new page of data from a json blob.String
getFirstPageUrl(String domain)
Generate first page url for a list result.String
getNextPageUrl(String domain)
Generate next page url for a list result.int
getPageSize()
String
getPreviousPageUrl(String domain)
Generate previous page url for a list result.List<T>
getRecords()
String
getUrl(String domain)
Generate page url for a list result.boolean
hasNextPage()
-
-
-
Method Detail
-
getFirstPageUrl
public String getFirstPageUrl(String domain)
Generate first page url for a list result.- Parameters:
domain
- domain to use- Returns:
- the first page url
-
getNextPageUrl
public String getNextPageUrl(String domain)
Generate next page url for a list result.- Parameters:
domain
- domain to use- Returns:
- the next page url
-
getPreviousPageUrl
public String getPreviousPageUrl(String domain)
Generate previous page url for a list result.- Parameters:
domain
- domain to use- Returns:
- the previous page url
-
getPageSize
public int getPageSize()
-
getUrl
public String getUrl(String domain)
Generate page url for a list result.- Parameters:
domain
- domain to use- Returns:
- the page url
-
hasNextPage
public boolean hasNextPage()
-
fromJson
public static <T> Page<T> fromJson(String recordKey, String json, Class<T> recordType, com.fasterxml.jackson.databind.ObjectMapper mapper)
Create a new page of data from a json blob.- Type Parameters:
T
- record class type- Parameters:
recordKey
- key which holds the recordsjson
- json blobrecordType
- resource typemapper
- json parser- Returns:
- a page of records of type T
-
-