public abstract class StripeCollection<T extends HasId> extends StripeObject implements StripeCollectionInterface<T>
The following code will have the effect of iterating through a single page worth of invoice data retrieve from the API:
foreach (Invoice invoice : Invoice.list(...).getData()) {
System.out.println("Current invoice = " + invoice.toString());
}
The class also provides a helper for iterating over collections that may be longer than a single page:
foreach (Invoice invoice : Invoice.list(...).autoPagingIterable()) {
System.out.println("Current invoice = " + invoice.toString());
}
PRETTY_PRINT_GSON| Constructor and Description |
|---|
StripeCollection() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Iterable<T> |
autoPagingIterable() |
java.lang.Iterable<T> |
autoPagingIterable(java.util.Map<java.lang.String,java.lang.Object> params) |
java.lang.Iterable<T> |
autoPagingIterable(java.util.Map<java.lang.String,java.lang.Object> params,
RequestOptions options)
Constructs an iterable that can be used to iterate across all objects
across all pages.
|
protected boolean |
canEqual(java.lang.Object other) |
boolean |
equals(java.lang.Object o) |
java.lang.Long |
getCount()
Deprecated.
Use pagination parameters instead.
|
java.util.List<T> |
getData() |
java.lang.Boolean |
getHasMore() |
java.lang.String |
getObject() |
RequestOptions |
getRequestOptions()
Get request options that were used to fetch the collection.
|
java.util.Map<java.lang.String,java.lang.Object> |
getRequestParams()
Get request parameters that were used to fetch the collection.
|
java.lang.Long |
getTotalCount() |
java.lang.String |
getUrl() |
int |
hashCode() |
void |
setCount(java.lang.Long count)
Deprecated.
Use pagination parameters instead.
|
void |
setData(java.util.List<T> data) |
void |
setHasMore(java.lang.Boolean hasMore) |
void |
setObject(java.lang.String object) |
void |
setRequestOptions(RequestOptions requestOptions)
Set request options that were used to fetch the collection.
|
void |
setRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Set request parameters that were used to fetch the collection.
|
void |
setTotalCount(java.lang.Long totalCount) |
void |
setUrl(java.lang.String url) |
equals, getLastResponse, setLastResponse, toJson, toStringpublic java.lang.Iterable<T> autoPagingIterable()
public java.lang.Iterable<T> autoPagingIterable(java.util.Map<java.lang.String,java.lang.Object> params)
public java.lang.Iterable<T> autoPagingIterable(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
params - request parameters (will override the parameters from the initial list request)options - request options (will override the options from the initial list request)public java.lang.String getObject()
@Deprecated public java.lang.Long getCount()
count attribute.public void setObject(java.lang.String object)
public void setData(java.util.List<T> data)
public void setHasMore(java.lang.Boolean hasMore)
public void setTotalCount(java.lang.Long totalCount)
public void setUrl(java.lang.String url)
@Deprecated public void setCount(java.lang.Long count)
count attribute.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectprotected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode in class java.lang.Objectpublic java.util.List<T> getData()
getData in interface StripeCollectionInterface<T extends HasId>public java.lang.Boolean getHasMore()
getHasMore in interface StripeCollectionInterface<T extends HasId>public java.lang.Long getTotalCount()
getTotalCount in interface StripeCollectionInterface<T extends HasId>public java.lang.String getUrl()
getUrl in interface StripeCollectionInterface<T extends HasId>public RequestOptions getRequestOptions()
StripeCollectionInterfacegetRequestOptions in interface StripeCollectionInterface<T extends HasId>public void setRequestOptions(RequestOptions requestOptions)
StripeCollectionInterfacesetRequestOptions in interface StripeCollectionInterface<T extends HasId>public java.util.Map<java.lang.String,java.lang.Object> getRequestParams()
StripeCollectionInterfacegetRequestParams in interface StripeCollectionInterface<T extends HasId>public void setRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)
StripeCollectionInterfacesetRequestParams in interface StripeCollectionInterface<T extends HasId>