new Predicate("CriteriaType", PredicateOperator.EQUALS, new String[] {"KEYWORD"});
selector.setPredicates(new Predicate[] {adGroupIdPredicate, criteriaTypePredicate});
while (morePages) {
// Get all ad group criteria.
AdGroupCriterionPage page = adGroupCriterionService.get(selector);
// Display ad group criteria.
if (page.getEntries() != null && page.getEntries().length > 0) {
// Display results.
for (AdGroupCriterion adGroupCriterionResult : page.getEntries()) {
System.out.println("Keyword ad group criterion with ad group id \""
+ adGroupCriterionResult.getAdGroupId() + "\", criterion id \""
+ adGroupCriterionResult.getCriterion().getId() + "\", text \""
+ ((Keyword) adGroupCriterionResult.getCriterion()).getText()
+ "\" and match type \""
+ ((Keyword) adGroupCriterionResult.getCriterion()).getMatchType() + "\" was found.");
}
} else {
System.out.println("No ad group criteria were found.");
}
offset += PAGE_SIZE;
selector.getPaging().setStartIndex(offset);
morePages = offset < page.getTotalNumEntries();
}
}