@Test public void testHasNextWithSpecifiedAdGroupBidLandscapePage() { AdGroupBidLandscapePage page = null; assertTrue(serviceQuery.hasNext(page)); int numBidLandscapePoints = 200; BidLandscapeLandscapePoint bidLandscapeLandscapePoint = new BidLandscapeLandscapePoint(); List<BidLandscapeLandscapePoint> bidLandscapeLandscapePoints = new ArrayList<>(); bidLandscapeLandscapePoints.addAll( Collections.nCopies(numBidLandscapePoints, bidLandscapeLandscapePoint)); AdGroupBidLandscape bidLandscape = mock(AdGroupBidLandscape.class); when(bidLandscape.getLandscapePoints()) .thenReturn(bidLandscapeLandscapePoints.toArray(new BidLandscapeLandscapePoint[0])); page = mock(AdGroupBidLandscapePage.class); when(page.getEntries()).thenReturn(new AdGroupBidLandscape[] {bidLandscape, bidLandscape}); serviceQuery = new ServiceQuery.Builder().fields("Id", "Name").limit(0, 100).build(); assertTrue(serviceQuery.hasNext(page)); serviceQuery = new ServiceQuery.Builder().fields("Id", "Name").limit(0, 500).build(); assertFalse(serviceQuery.hasNext(page)); }
@Override public boolean hasNext(@Nullable Page page) { return (page == null) || startIndex + pageSize < page.getTotalNumEntries(); }
ServiceQuery implements ServiceQueryInterface<Page> { @Override public boolean hasNext(@Nullable Page page) { return (page == null) || startIndex + pageSize < page.getTotalNumEntries(); } }
ServiceQuery implements ServiceQueryInterface<Page> { @Override public boolean hasNext(@Nullable Page page) { return (page == null) || startIndex + pageSize < page.getTotalNumEntries(); } ServiceQuery(String partialAwqlQuery, int startIndex, int pageSize); }
ServiceQuery implements ServiceQueryInterface<Page> { @Override public boolean hasNext(@Nullable Page page) { return (page == null) || startIndex + pageSize < page.getTotalNumEntries(); } ServiceQuery(String partialAwqlQuery, int startIndex, int pageSize); @Override ServiceQuery nextPage(@Nullable Page page); ServiceQuery nextPage(@Nullable AdGroupBidLandscapePage page); ServiceQuery nextPage(@Nullable CriterionBidLandscapePage page); @Override boolean hasNext(@Nullable Page page); boolean hasNext(@Nullable AdGroupBidLandscapePage page); boolean hasNext(@Nullable CriterionBidLandscapePage page); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
ServiceQuery implements ServiceQueryInterface<Page> { @Override public boolean hasNext(@Nullable Page page) { return (page == null) || startIndex + pageSize < page.getTotalNumEntries(); } ServiceQuery(String partialAwqlQuery, int startIndex, int pageSize); @Override ServiceQuery nextPage(@Nullable Page page); ServiceQuery nextPage(@Nullable AdGroupBidLandscapePage page); ServiceQuery nextPage(@Nullable CriterionBidLandscapePage page); @Override boolean hasNext(@Nullable Page page); boolean hasNext(@Nullable AdGroupBidLandscapePage page); boolean hasNext(@Nullable CriterionBidLandscapePage page); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }