All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.bingads.v13.internal.bulk.SimpleBulkMapping Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 13.0.22.1
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy