new Predicate("CampaignId", PredicateOperator.IN, new String[] {campaignId.toString()});
selector.setPredicates(new Predicate[] {campaignIdPredicate});
while (morePages) {
// Get all ad groups.
AdGroupPage page = adGroupService.get(selector);
// Display ad groups.
if (page.getEntries() != null) {
for (AdGroup adGroup : page.getEntries()) {
System.out.println("Ad group with name \"" + adGroup.getName() + "\" and id \""
+ adGroup.getId() + "\" was found.");
}
} else {
System.out.println("No ad groups were found.");
}
offset += PAGE_SIZE;
selector.getPaging().setStartIndex(offset);
morePages = offset < page.getTotalNumEntries();
}
}