com.microsoft.bingads.v13.bulk.entities.BulkDynamicSearchAd Maven / Gradle / Ivy
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.AdType;
import com.microsoft.bingads.v13.campaignmanagement.DynamicSearchAd;
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.StringTable;
/**
* Represents a dynamic search ad.
*
* This class exposes the {@link #setDynamicSearchtAd} and {@link #getDynamicSearchAd} methods
* that can be used to read and write fields of the Dynamic Search Ad record in a bulk file.
*
*
* For more information, see Dynamic Search Ad at
* https://go.microsoft.com/fwlink/?linkid=846127
*
*
* @see BulkServiceManager
* @see BulkOperation
* @see BulkFileReader
* @see BulkFileWriter
*/
public class BulkDynamicSearchAd extends BulkAd {
private static final List> MAPPINGS;
static {
List> m = new ArrayList>();
m.add(new SimpleBulkMapping(StringTable.Text,
new Function() {
@Override
public String apply(BulkDynamicSearchAd c) {
return c.getAd().getText();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkDynamicSearchAd c) {
c.getAd().setText(v);
}
}
));
m.add(new SimpleBulkMapping(StringTable.Path1,
new Function() {
@Override
public String apply(BulkDynamicSearchAd c) {
return c.getAd().getPath1();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkDynamicSearchAd c) {
c.getAd().setPath1(v);
}
},
true
));
m.add(new SimpleBulkMapping(StringTable.Path2,
new Function() {
@Override
public String apply(BulkDynamicSearchAd c) {
return c.getAd().getPath2();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkDynamicSearchAd c) {
c.getAd().setPath2(v);
}
},
true
));
m.add(new SimpleBulkMapping(StringTable.TextPart2,
new Function() {
@Override
public String apply(BulkDynamicSearchAd c) {
return c.getAd().getTextPart2();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkDynamicSearchAd c) {
c.getAd().setTextPart2(v);
}
},
true
));
MAPPINGS = Collections.unmodifiableList(m);
}
@Override
public void processMappingsToRowValues(RowValues values, boolean excludeReadonlyData) {
validatePropertyNotNull(getDynamicSearchAd(), "DynamicSearchAd");
super.processMappingsToRowValues(values, excludeReadonlyData);
MappingHelpers.convertToValues(this, values, MAPPINGS);
}
@Override
public void processMappingsFromRowValues(RowValues values) {
this.setAd(new DynamicSearchAd());
this.getAd().setType(AdType.DYNAMIC_SEARCH);
super.processMappingsFromRowValues(values);
MappingHelpers.convertToEntity(values, MAPPINGS, this);
}
/**
* Gets the dynamic search ad.
*/
public DynamicSearchAd getDynamicSearchAd() {
return this.ad;
}
/**
* Sets the dynamic search ad.
*/
public void setDynamicSearchAd(DynamicSearchAd ad) {
this.setAd(ad);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy