Package com.google.api.ads.dfp.v201208

Examples of com.google.api.ads.dfp.v201208.CustomCriteria


   */
  private static String getCustomCriteriaSetString(CustomCriteriaNode root, int level) {
    StringBuilder sb = new StringBuilder();
    sb.append(StringUtils.repeat("\t", level));
    if (root instanceof CustomCriteria) {
      CustomCriteria customCriteria = (CustomCriteria) root;
      sb.append(String.format("Custom criteria: operator: [%s] key: [%s] values: [%s]\n",
          customCriteria.getOperator(), customCriteria.getKeyId(),
          StringUtils.join(ArrayUtils.toObject(customCriteria.getValueIds()), ",")));
      return sb.toString();
    } else if (root instanceof CustomCriteriaSet){
      CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root;
      sb.append(String.format("Custom criteria set: operator: [%s] children: \n",
          customCriteriaSet.getLogicalOperator()));
View Full Code Here


      Long[] customCriteriaIds3 =
        new Long[] {Long.parseLong("INSERT_CUSTOM_TARGETING_KEY_ID_HERE"),
            Long.parseLong("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")};

      // Create custom criteria.
      CustomCriteria customCriteria1 = new CustomCriteria();
      customCriteria1.setKeyId(customCriteriaIds1[0]);
      customCriteria1.setValueIds(new long[] {customCriteriaIds1[1]});
      customCriteria1.setOperator(CustomCriteriaComparisonOperator.IS);

      CustomCriteria customCriteria2 = new CustomCriteria();
      customCriteria2.setKeyId(customCriteriaIds2[0]);
      customCriteria2.setValueIds(new long[] {customCriteriaIds2[1]});
      customCriteria2.setOperator(CustomCriteriaComparisonOperator.IS_NOT);

      CustomCriteria customCriteria3 = new CustomCriteria();
      customCriteria3.setKeyId(customCriteriaIds3[0]);
      customCriteria3.setValueIds(new long[] {customCriteriaIds3[1]});
      customCriteria3.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create the custom criteria set that will resemble:
      //
      // (customCriteria1.key == customCriteria1.value OR
      //     (customCriteria2.key != customCriteria2.value AND
View Full Code Here

   */
  private static String getCustomCriteriaSetString(CustomCriteriaNode root, int level) {
    StringBuilder sb = new StringBuilder();
    sb.append(StringUtils.repeat("\t", level));
    if (root instanceof CustomCriteria) {
      CustomCriteria customCriteria = (CustomCriteria) root;
      sb.append(String.format("Custom criteria: operator: [%s] key: [%s] values: [%s]\n",
          customCriteria.getOperator(), customCriteria.getKeyId(),
          StringUtils.join(ArrayUtils.toObject(customCriteria.getValueIds()), ",")));
      return sb.toString();
    } else if (root instanceof CustomCriteriaSet){
      CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root;
      sb.append(String.format("Custom criteria set: operator: [%s] children: \n",
          customCriteriaSet.getLogicalOperator()));
View Full Code Here

          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE");
      Long contentCustomTargetingValueId =
          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE");

      // Create custom criteria for the content metadata targeting.
      CustomCriteria contentCustomCriteria = new CustomCriteria();
      contentCustomCriteria.setKeyId(contentCustomTargetingKeyId);
      contentCustomCriteria.setValueIds(new long[] {contentCustomTargetingValueId});
      contentCustomCriteria.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create custom criteria set.
      CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet();
      customCriteriaSet.setChildren(new CustomCriteriaNode[] {contentCustomCriteria});
View Full Code Here

      Long[] customCriteriaIds3 =
        new Long[] {Long.parseLong("INSERT_CUSTOM_TARGETING_KEY_ID_HERE"),
            Long.parseLong("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")};

      // Create custom criteria.
      CustomCriteria customCriteria1 = new CustomCriteria();
      customCriteria1.setKeyId(customCriteriaIds1[0]);
      customCriteria1.setValueIds(new long[] {customCriteriaIds1[1]});
      customCriteria1.setOperator(CustomCriteriaComparisonOperator.IS);

      CustomCriteria customCriteria2 = new CustomCriteria();
      customCriteria2.setKeyId(customCriteriaIds2[0]);
      customCriteria2.setValueIds(new long[] {customCriteriaIds2[1]});
      customCriteria2.setOperator(CustomCriteriaComparisonOperator.IS_NOT);

      CustomCriteria customCriteria3 = new CustomCriteria();
      customCriteria3.setKeyId(customCriteriaIds3[0]);
      customCriteria3.setValueIds(new long[] {customCriteriaIds3[1]});
      customCriteria3.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create the custom criteria set that will resemble:
      //
      // (customCriteria1.key == customCriteria1.value OR
      //     (customCriteria2.key != customCriteria2.value AND
View Full Code Here

   */
  private static String getCustomCriteriaSetString(CustomCriteriaNode root, int level) {
    StringBuilder sb = new StringBuilder();
    sb.append(StringUtils.repeat("\t", level));
    if (root instanceof CustomCriteria) {
      CustomCriteria customCriteria = (CustomCriteria) root;
      sb.append(String.format("Custom criteria: operator: [%s] key: [%s] values: [%s]\n",
          customCriteria.getOperator(), customCriteria.getKeyId(),
          StringUtils.join(ArrayUtils.toObject(customCriteria.getValueIds()), ",")));
      return sb.toString();
    } else if (root instanceof CustomCriteriaSet){
      CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root;
      sb.append(String.format("Custom criteria set: operator: [%s] children: \n",
          customCriteriaSet.getLogicalOperator()));
View Full Code Here

          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE");
      Long contentCustomTargetingValueId =
          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE");

      // Create custom criteria for the content metadata targeting.
      CustomCriteria contentCustomCriteria = new CustomCriteria();
      contentCustomCriteria.setKeyId(contentCustomTargetingKeyId);
      contentCustomCriteria.setValueIds(new long[] {contentCustomTargetingValueId});
      contentCustomCriteria.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create custom criteria set.
      CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet();
      customCriteriaSet.setChildren(new CustomCriteriaNode[] {contentCustomCriteria});
View Full Code Here

          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_KEY_ID_HERE");
      Long contentCustomTargetingValueId =
          Long.parseLong("INSERT_CONTENT_CUSTOM_TARGETING_VALUE_ID_HERE");

      // Create custom criteria for the content metadata targeting.
      CustomCriteria contentCustomCriteria = new CustomCriteria();
      contentCustomCriteria.setKeyId(contentCustomTargetingKeyId);
      contentCustomCriteria.setValueIds(new long[] {contentCustomTargetingValueId});
      contentCustomCriteria.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create custom criteria set.
      CustomCriteriaSet customCriteriaSet = new CustomCriteriaSet();
      customCriteriaSet.setChildren(new CustomCriteriaNode[] {contentCustomCriteria});
View Full Code Here

      Long[] customCriteriaIds3 =
        new Long[] {Long.parseLong("INSERT_CUSTOM_TARGETING_KEY_ID_HERE"),
            Long.parseLong("INSERT_CUSTOM_TARGETING_VALUE_ID_HERE")};

      // Create custom criteria.
      CustomCriteria customCriteria1 = new CustomCriteria();
      customCriteria1.setKeyId(customCriteriaIds1[0]);
      customCriteria1.setValueIds(new long[] {customCriteriaIds1[1]});
      customCriteria1.setOperator(CustomCriteriaComparisonOperator.IS);

      CustomCriteria customCriteria2 = new CustomCriteria();
      customCriteria2.setKeyId(customCriteriaIds2[0]);
      customCriteria2.setValueIds(new long[] {customCriteriaIds2[1]});
      customCriteria2.setOperator(CustomCriteriaComparisonOperator.IS_NOT);

      CustomCriteria customCriteria3 = new CustomCriteria();
      customCriteria3.setKeyId(customCriteriaIds3[0]);
      customCriteria3.setValueIds(new long[] {customCriteriaIds3[1]});
      customCriteria3.setOperator(CustomCriteriaComparisonOperator.IS);

      // Create the custom criteria set that will resemble:
      //
      // (customCriteria1.key == customCriteria1.value OR
      //     (customCriteria2.key != customCriteria2.value AND
View Full Code Here

   */
  private static String getCustomCriteriaSetString(CustomCriteriaNode root, int level) {
    StringBuilder sb = new StringBuilder();
    sb.append(StringUtils.repeat("\t", level));
    if (root instanceof CustomCriteria) {
      CustomCriteria customCriteria = (CustomCriteria) root;
      sb.append(String.format("Custom criteria: operator: [%s] key: [%s] values: [%s]\n",
          customCriteria.getOperator(), customCriteria.getKeyId(),
          StringUtils.join(ArrayUtils.toObject(customCriteria.getValueIds()), ",")));
      return sb.toString();
    } else if (root instanceof CustomCriteriaSet){
      CustomCriteriaSet customCriteriaSet = (CustomCriteriaSet) root;
      sb.append(String.format("Custom criteria set: operator: [%s] children: \n",
          customCriteriaSet.getLogicalOperator()));
View Full Code Here

TOP

Related Classes of com.google.api.ads.dfp.v201208.CustomCriteria

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.