/** * Builds pagination request with the specified path. * * @param path the specified path, see {@link #PAGINATION_PATH_PATTERN} * for the details * @return pagination request json object, for example, * <pre> * { * "paginationCurrentPageNum": int, * "paginationPageSize": int, * "paginationWindowSize": int * } * </pre> * @see #PAGINATION_PATH_PATTERN */ public static JSONObject buildPaginationRequest(final String path) { final Integer currentPageNum = getCurrentPageNum(path); final Integer pageSize = getPageSize(path); final Integer windowSize = getWindowSize(path); final JSONObject ret = new JSONObject(); ret.put(Pagination.PAGINATION_CURRENT_PAGE_NUM, currentPageNum); ret.put(Pagination.PAGINATION_PAGE_SIZE, pageSize); ret.put(Pagination.PAGINATION_WINDOW_SIZE, windowSize); return ret; }