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 Object
implements IPagination
Class used to store pagination data - number of desired page and size of each page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
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 Details
-
Pagination
-
-
Method Details
-
getPageSize
- Specified by:
getPageSize
in interfaceIPagination
-
getPageNumber
- Specified by:
getPageNumber
in interfaceIPagination
-
resolveFields
@ThingworxExtensionApiMethod(since={9,0,0}) public void resolveFields(DataShapeDefinition dataShape) - Specified by:
resolveFields
in interfaceIPagination
-
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:
IllegalArgumentException
- when JSONObject elements have zero as a value.
-