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

com.microsoft.bingads.v13.internal.bulk.entities.BulkEntityIdentifier 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.entities;

import com.microsoft.bingads.v13.bulk.entities.BulkError;
import com.microsoft.bingads.v13.internal.bulk.BulkObject;
import com.microsoft.bingads.v13.internal.bulk.BulkObjectWriter;
import com.microsoft.bingads.v13.internal.bulk.BulkRecordReader;
import com.microsoft.bingads.v13.internal.bulk.TryResult;
import java.io.IOException;

public abstract class BulkEntityIdentifier extends BulkObject {

    @Override
    public abstract boolean equals(Object other);

    public abstract boolean isDeleteRow();

    public abstract MultiRecordBulkEntity createEntityWithThisIdentifier();

    @Override
    public void write(BulkObjectWriter rowWriter, boolean excludeReadonlyData) throws IOException {
        rowWriter.writeObjectRow(this);
    }

    @Override
    public void readRelatedData(BulkRecordReader reader) {
        // If this is a delete all row, just skip any error rows after this delete row
        if (isDeleteRow()) {
            boolean hasMoreErrors = true;

            while (hasMoreErrors) {
                TryResult errorResult = reader.tryRead(BulkError.class);
                hasMoreErrors = (errorResult.isSuccessful());
            }
        }
    }

    @Override
    public boolean canEncloseInMultilineEntity() {
        return true;
    }

    @Override
    public MultiRecordBulkEntity encloseInMultilineEntity() {
        return createEntityWithThisIdentifier();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy