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.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.String |
getUrl() |
int |
hashCode() |
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 |
setUrl(java.lang.String url) |
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLastResponse, setLastResponse
public 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()
public void setObject(java.lang.String object)
public void setData(java.util.List<T> data)
public void setHasMore(java.lang.Boolean hasMore)
public void setUrl(java.lang.String url)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
protected boolean canEqual(java.lang.Object other)
public int hashCode()
hashCode
in class java.lang.Object
public 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.String getUrl()
getUrl
in interface StripeCollectionInterface<T extends HasId>
public RequestOptions getRequestOptions()
StripeCollectionInterface
getRequestOptions
in interface StripeCollectionInterface<T extends HasId>
public void setRequestOptions(RequestOptions requestOptions)
StripeCollectionInterface
setRequestOptions
in interface StripeCollectionInterface<T extends HasId>
public java.util.Map<java.lang.String,java.lang.Object> getRequestParams()
StripeCollectionInterface
getRequestParams
in interface StripeCollectionInterface<T extends HasId>
public void setRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)
StripeCollectionInterface
setRequestParams
in interface StripeCollectionInterface<T extends HasId>