com.microsoft.bingads.v13.bulk.BulkEntityIterable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of microsoft.bingads Show documentation
Show all versions of microsoft.bingads Show documentation
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.
package com.microsoft.bingads.v13.bulk;
import java.io.Closeable;
import java.io.IOException;
import java.util.Iterator;
import com.microsoft.bingads.v13.bulk.entities.BulkEntity;
import com.microsoft.bingads.v13.internal.bulk.BulkRecordReader;
import com.microsoft.bingads.v13.internal.bulk.EntityIterator;
/**
* Allows to iterate through a list of entities stored in a file.
*/
public class BulkEntityIterable implements Iterable, Closeable {
private final BulkRecordReader reader;
private final EntityIterator entityIterator;
/**
* Reserved for internal use.
*
* @param reader the bulk stream reader instance
* @param isForFullDownload is the reader for full download
*/
public BulkEntityIterable(BulkRecordReader reader, boolean isForFullDownload) {
this.reader = reader;
entityIterator = new EntityIterator(reader, isForFullDownload);
}
@Override
public Iterator iterator() {
return entityIterator;
}
@Override
public void close() throws IOException {
reader.close();
}
}