code: public static Pager getPagerFromParams(MultivaluedMap<String, String> params) {
  		Pager pager = new Pager();
  		pager.setPage(NumberUtils.toLong(paramOrDefault(params, "page", ""), 0));
  		if (pager.getPage() > Config.MAX_PAGES) {
  			pager.setPage(Config.MAX_PAGES);
  		}
  		pager.setLimit(NumberUtils.toInt(paramOrDefault(params, "limit", ""), pager.getLimit()));
  		if (pager.getLimit() > Config.MAX_PAGE_LIMIT) {
  			pager.setLimit(Config.MAX_PAGE_LIMIT);
  		}
  		pager.setSortby(paramOrDefault(params, "sort", pager.getSortby()));
  		pager.setDesc(Boolean.parseBoolean(paramOrDefault(params, "desc", "true")));
  		pager.setLastKey(paramOrDefault(params, "lastKey", null));
  		return pager;
  	}
docs: Returns a {@link Pager} instance populated from request parameters.
  @param params query params map
  @return a Pager