@Test public void testIndicatorDataPages() throws JSONException { Boolean lastPage = UnsdDataParser.isLastPage(dataResponse2015AreaLimited); assertNotNull("Could not parse page info", lastPage); assertTrue("The response wasn't the last page.", lastPage); lastPage = UnsdDataParser.isLastPage(dataResponseUnlimited); assertNotNull("Could not parse page info", lastPage); assertFalse("The response was the last page.", lastPage); }
protected static boolean isLastPage(JSONObject response) throws JSONException { int totalPages = response.getInt("totalPages"); if (totalPages < 1) { return true; } int pageNumber = response.getInt("pageNumber"); return pageNumber >= totalPages; }
UnsdDataParser { protected static boolean isLastPage(JSONObject response) throws JSONException { int totalPages = response.getInt("totalPages"); if (totalPages < 1) { return true; } int pageNumber = response.getInt("pageNumber"); return pageNumber >= totalPages; } }
UnsdDataParser { protected static boolean isLastPage(JSONObject response) throws JSONException { int totalPages = response.getInt("totalPages"); if (totalPages < 1) { return true; } int pageNumber = response.getInt("pageNumber"); return pageNumber >= totalPages; } UnsdDataParser(UnsdConfig config); }
UnsdDataParser { protected static boolean isLastPage(JSONObject response) throws JSONException { int totalPages = response.getInt("totalPages"); if (totalPages < 1) { return true; } int pageNumber = response.getInt("pageNumber"); return pageNumber >= totalPages; } UnsdDataParser(UnsdConfig config); Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes); StatisticalIndicatorDataDimension getTimeperiodDimensionFromIndicatorData(String timePeriodDimensionId,
            String indicator, String[] areaCodes); static void parseTimePeriod(Map<Integer, Set<Integer>> geoAreaCodesForYears, JSONObject response); static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas(
            Map<Integer,  Set<Integer>> countOfAreaCodesForYear); }
UnsdDataParser { protected static boolean isLastPage(JSONObject response) throws JSONException { int totalPages = response.getInt("totalPages"); if (totalPages < 1) { return true; } int pageNumber = response.getInt("pageNumber"); return pageNumber >= totalPages; } UnsdDataParser(UnsdConfig config); Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes); StatisticalIndicatorDataDimension getTimeperiodDimensionFromIndicatorData(String timePeriodDimensionId,
            String indicator, String[] areaCodes); static void parseTimePeriod(Map<Integer, Set<Integer>> geoAreaCodesForYears, JSONObject response); static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas(
            Map<Integer,  Set<Integer>> countOfAreaCodesForYear);  }