io.intercom.api.CompanyCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of intercom-java Show documentation
Show all versions of intercom-java Show documentation
Java bindings for the Intercom API
package io.intercom.api;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Iterator;
import java.util.List;
@SuppressWarnings("UnusedDeclaration")
@JsonIgnoreProperties(ignoreUnknown = true)
public class CompanyCollection extends TypedDataCollection implements Iterator {
protected TypedDataCollectionIterator iterator;
@JsonProperty("total_count")
private long totalCount;
public CompanyCollection() {
type = "company.list";
iterator = new TypedDataCollectionIterator(this);
}
public CompanyCollection(List companies) {
this();
this.page = companies;
}
@SuppressWarnings("EmptyMethod")
@JsonProperty("companies")
@Override
public List getPage() {
return super.getPage();
}
public long getTotalCount() {
return totalCount;
}
@Override
public CompanyCollection nextPage() {
return fetchNextPage(CompanyCollection.class);
}
public boolean hasNext() {
return iterator.hasNext();
}
public Company next() {
return iterator.next();
}
public void remove() {
iterator.remove();
}
@Override
public String toString() {
return "CompanyCollection{" +
", totalCount=" + totalCount +
"} " + super.toString();
}
void addCompany(Company company) {
page.add(company);
}
}