com.microsoft.bingads.v13.bulk.entities.BulkDurationGoal 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.DurationGoal;
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 duration goal that can be read or written in a bulk file.
*
* This class exposes the {@link BulkDurationGoal#setDurationGoal} and {@link BulkDurationGoal#getDurationGoal}
* methods that can be used to read and write fields of the Duration Goal record in a bulk file.
*
*
* For more information, see Duration Goal at
* https://go.microsoft.com/fwlink/?linkid=846127.
*
*
* @see BulkServiceManager
* @see BulkOperation
* @see BulkFileReader
* @see BulkFileWriter
*/
public class BulkDurationGoal extends BulkConversionGoal {
private static final List> MAPPINGS;
static {
List> m = new ArrayList>();
m.add(new SimpleBulkMapping(StringTable.MinimumDurationInSecond,
new Function() {
@Override
public Integer apply(BulkDurationGoal c) {
return c.getConversionGoal().getMinimumDurationInSeconds();
}
},
new BiConsumer() {
@Override
public void accept(String v, BulkDurationGoal c) {
c.getConversionGoal().setMinimumDurationInSeconds(StringExtensions.parseOptional(v, new Function() {
@Override
public Integer apply(String value) {
return Integer.parseInt(value);
}
}));
}
}
));
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);
}
/**
* Get the duration goal.
*/
public DurationGoal getDurationGoal() {
return this.getConversionGoal();
}
/**
* Set the duration goal.
*/
public void setDurationGoal(DurationGoal DurationGoal) {
this.setConversionGoal(DurationGoal);
}
@Override
public DurationGoal createConversionGoal() {
return new DurationGoal();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy