com.microsoft.bingads.v13.bulk.entities.BulkCombinedList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microsoft.bingads Show documentation
Show all versions of microsoft.bingads Show documentation
The Bing Ads Java SDK is a library improving developer experience when working with the Bing Ads services by providing high-level access to features such as Bulk API, OAuth Authorization and SOAP API.
package com.microsoft.bingads.v13.bulk.entities;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
import com.microsoft.bingads.internal.functionalinterfaces.Function;
import com.microsoft.bingads.v13.bulk.BulkFileReader;
import com.microsoft.bingads.v13.bulk.BulkFileWriter;
import com.microsoft.bingads.v13.bulk.BulkOperation;
import com.microsoft.bingads.v13.bulk.BulkServiceManager;
import com.microsoft.bingads.v13.campaignmanagement.CombinedList;
import com.microsoft.bingads.v13.internal.bulk.BulkMapping;
import com.microsoft.bingads.v13.internal.bulk.MappingHelpers;
import com.microsoft.bingads.v13.internal.bulk.RowValues;
import com.microsoft.bingads.v13.internal.bulk.SimpleBulkMapping;
import com.microsoft.bingads.v13.internal.bulk.StringExtensions;
import com.microsoft.bingads.v13.internal.bulk.StringTable;
/**
* Represents a Combined List that can be read or written in a bulk file.
*
* This class exposes the {@link BulkCombinedList#setCombinedList} and {@link BulkCombinedList#getCombinedList}
* methods that can be used to read and write fields of the Combined List Audience record in a bulk file.
*
*
* For more information, see Combined List Audience at
* https://go.microsoft.com/fwlink/?linkid=846127.
*
*
* @see BulkServiceManager
* @see BulkOperation
* @see BulkFileReader
* @see BulkFileWriter
*/
public class BulkCombinedList extends BulkAudience {
private static final List> MAPPINGS;
static {
List> m = new ArrayList>();
m.add(new SimpleBulkMapping(StringTable.CombinationRule,
new Function() {
@Override
public String apply(BulkCombinedList c) {
return StringExtensions.writeCombinationRulesBulkString(c.getCombinedList().getCombinationRules());
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkCombinedList c) {
c.getCombinedList().setCombinationRules(StringExtensions.parseCombinationRules(v));
}
}
));
MAPPINGS = Collections.unmodifiableList(m);
}
@Override
public void processMappingsFromRowValues(RowValues values) {
super.processMappingsFromRowValues(values);
MappingHelpers.convertToEntity(values, MAPPINGS, this);
}
@Override
public void processMappingsToRowValues(RowValues values, boolean excludeReadonlyData) {
super.processMappingsToRowValues(values, excludeReadonlyData);
MappingHelpers.convertToValues(this, values, MAPPINGS);
}
/**
* Gets the combined list.
*/
public CombinedList getCombinedList() {
return this.getAudience();
}
/**
* Sets the combined list.
*/
public void setCombinedList(CombinedList combinedList) {
this.setAudience(combinedList);
}
@Override
public CombinedList createAudience() {
return new CombinedList();
}
}