com.microsoft.bingads.v13.internal.bulk.SimpleBulkMapping Maven / Gradle / Ivy
package com.microsoft.bingads.v13.internal.bulk;
import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer;
import com.microsoft.bingads.internal.functionalinterfaces.Function;
import com.microsoft.bingads.v13.bulk.entities.BulkEntity;
/**
* A simple bulk mapping which translates values from a single field to a single
* column
*
* @param The type of {@link BulkEntity} that the binding is for
* @param The type of the property on the {@link BulkEntity} that is
* being managed by this mapping
*/
public class SimpleBulkMapping extends SingleFieldBulkMapping {
private String csvHeader;
public SimpleBulkMapping(String csvHeader, Function fieldToCsv, BiConsumer csvToField, boolean passNulls) {
super(fieldToCsv, csvToField, passNulls);
this.csvHeader = csvHeader;
}
/**
* Constructor for mappings
*
* @param csvHeader Name of the header
* @param fieldToCsv Function to get the value from an entity
* @param csvToField Function to set the value from CSV on an entity
*/
public SimpleBulkMapping(String csvHeader, Function fieldToCsv, BiConsumer csvToField) {
this(csvHeader, fieldToCsv, csvToField, false);
}
@Override
public String getHeader(TEntity entity) {
return this.csvHeader;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy