Class Pagination
- java.lang.Object
-
- com.thingworx.types.data.pagination.Pagination
-
- All Implemented Interfaces:
IPagination
@ThingworxExtensionApiClass(since={9,0,0}, canInstantiate=true) public class Pagination extends java.lang.Object implements IPagination
Class used to store pagination data - number of desired page and size of each page.
-
-
Constructor Summary
Constructors Constructor Description Pagination(int pageSize, int pageNumber)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getPageNumber()
int
getPageSize()
static Pagination
ParsePagination(org.json.JSONObject jsonPagination)
Build aPagination
object from the suppliedJSONObject
.void
resolveFields(DataShapeDefinition dataShape)
org.json.JSONObject
toJSON()
Creates a JSON representation of pagination containing page size and page number.
-
-
-
Constructor Detail
-
Pagination
@ThingworxExtensionApiMethod(since={9,0,0}) public Pagination(int pageSize, int pageNumber)
-
-
Method Detail
-
getPageSize
@ThingworxExtensionApiMethod(since={9,0,0}) public int getPageSize()
- Specified by:
getPageSize
in interfaceIPagination
-
getPageNumber
@ThingworxExtensionApiMethod(since={9,0,0}) public int getPageNumber()
- Specified by:
getPageNumber
in interfaceIPagination
-
resolveFields
@ThingworxExtensionApiMethod(since={9,0,0}) public void resolveFields(DataShapeDefinition dataShape)
- Specified by:
resolveFields
in interfaceIPagination
-
toJSON
@ThingworxExtensionApiMethod(since={9,0,0}) public org.json.JSONObject toJSON()
Creates a JSON representation of pagination containing page size and page number.- Specified by:
toJSON
in interfaceIPagination
- Returns:
- a
JSONObject
containing pagination information.
-
ParsePagination
@ThingworxExtensionApiMethod(since={9,0,0}) public static Pagination ParsePagination(org.json.JSONObject jsonPagination)
Build aPagination
object from the suppliedJSONObject
.- Parameters:
jsonPagination
- a JSONObject containing the configuration,null
is also a valid argument - means no pagination information provided in the JSON Query.- Returns:
- the constructed Pagination representing the supplied configuration or null when no pagination information provided in the JSON Query.
- Throws:
java.lang.IllegalArgumentException
- when JSONObject elements have zero as a value.
-
-