Package com.google.api.ads.adwords.jaxws.v201309.cm

Examples of com.google.api.ads.adwords.jaxws.v201309.cm.Paging


  public void testUniqueInternalOrderByState() {
    SelectorBuilder builder = new SelectorBuilder();
    Selector selectorOne = builder.orderAscBy("Id").build();
    Selector selectorTwo = builder.build();

    OrderBy orderTwo = selectorTwo.getOrdering().get(0);
    orderTwo.setField("Status");

    Assert.assertEquals("Id", selectorOne.getOrdering().get(0).getField());
    Assert.assertEquals("Status", selectorTwo.getOrdering().get(0).getField());
  }
View Full Code Here


      newDateRange.setMin(this.dateRange.getMin());
      newDateRange.setMax(this.dateRange.getMax());
      selectorCopy.setDateRange(newDateRange);
    }
    if (this.paging != null) {
      Paging newPaging = new Paging();
      newPaging.setStartIndex(this.paging.getStartIndex());
      newPaging.setNumberResults(this.paging.getNumberResults());
      selectorCopy.setPaging(newPaging);
    }

    return selectorCopy;
  }
View Full Code Here

   * @param additionalOffset the amount that will be added to the offset
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder increaseOffsetBy(int additionalOffset) {
    if (this.paging == null) {
      this.paging = new Paging();
    }
    Integer startIndex = this.paging.getStartIndex();
    if (startIndex == null) {
      startIndex = 0;
    }
View Full Code Here

   *
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder limit(int limit) {
    if (this.paging == null) {
      this.paging = new Paging();
    }
    this.paging.setNumberResults(limit);
    return this;
  }
View Full Code Here

   * @param offset the offset
   * @return the builder itself to proceed the chain.
   */
  public SelectorBuilder offset(int offset) {
    if (this.paging == null) {
      this.paging = new Paging();
    }
    this.paging.setStartIndex(offset);
    return this;
  }
View Full Code Here

   * @return the new set of Predicate objects with different instance for each of the Predicate
   */
  private Set<Predicate> copyPredicatesSet() {
    Set<Predicate> predicatesCopy = Sets.newLinkedHashSet();
    for (Predicate predicate : this.predicates) {
      Predicate copyPredicate = new Predicate();
      copyPredicate.setField(predicate.getField());
      copyPredicate.setOperator(predicate.getOperator());
      copyPredicate.getValues().addAll(predicate.getValues());
      predicatesCopy.add(copyPredicate);
    }
    return predicatesCopy;
  }
View Full Code Here

   * @param propertyValue the value of the property
   * @return the builder itself to proceed the chain.
   */
  private SelectorBuilder singleValuePredicate(
      String field, String propertyValue, PredicateOperator operator) {
    Predicate predicate = new Predicate();
    predicate.setField(field);
    predicate.setOperator(operator);

    predicate.getValues().add(propertyValue);

    this.predicates.add(predicate);

    return this;
  }
View Full Code Here

      String field, String[] propertyValues, PredicateOperator operator) {
    if (propertyValues == null) {
      return this;
    }

    Predicate predicate = new Predicate();
    predicate.setOperator(operator);
    predicate.setField(field);

    for (String propertyValue : propertyValues) {
      predicate.getValues().add(propertyValue);
    }

    this.predicates.add(predicate);

    return this;
View Full Code Here

    Selector selector = builder.build();

    Assert.assertNotNull(selector.getPredicates());
    Assert.assertEquals(1, selector.getPredicates().size());

    Predicate predicate = selector.getPredicates().get(0);
    Assert.assertEquals("Id", predicate.getField());
    Assert.assertEquals(PredicateOperator.EQUALS, predicate.getOperator());
    Assert.assertNotNull(predicate.getValues());
    Assert.assertEquals(1, predicate.getValues().size());
    Assert.assertEquals("10", predicate.getValues().get(0));

  }
View Full Code Here

    Selector selector = builder.build();

    Assert.assertNotNull(selector.getPredicates());
    Assert.assertEquals(1, selector.getPredicates().size());

    Predicate predicate = selector.getPredicates().get(0);
    Assert.assertEquals("Status", predicate.getField());
    Assert.assertEquals(PredicateOperator.IN, predicate.getOperator());
    Assert.assertNotNull(predicate.getValues());
    Assert.assertEquals(2, predicate.getValues().size());
    Assert.assertEquals(CampaignStatus.ACTIVE.toString(), predicate.getValues().get(0));
    Assert.assertEquals(CampaignStatus.DELETED.toString(), predicate.getValues().get(1));

  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.jaxws.v201309.cm.Paging

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.