public abstract class StripeCollection<T extends HasId> extends StripeObject implements StripeCollectionInterface<T>
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 |
|---|---|
Iterable<T> |
autoPagingIterable()
Returns an iterable that can be used to iterate across all objects
across all pages.
|
Integer |
getCount()
3/2014: Legacy (from before newstyle pagination API)
|
List<T> |
getData() |
Boolean |
getHasMore() |
RequestOptions |
getRequestOptions()
Get request options that were used to fetch the collection.
|
Map<String,Object> |
getRequestParams()
Get request parameters that were used to fetch the collection.
|
Integer |
getTotalCount() |
String |
getURL() |
void |
setCount(Integer count)
3/2014: Legacy (from before newstyle pagination API)
|
void |
setData(List<T> data) |
void |
setHasMore(Boolean hasMore) |
void |
setRequestOptions(RequestOptions requestOptions)
Set request options that were used to fetch the collection.
|
void |
setRequestParams(Map<String,Object> requestParams)
Set request parameters that were used to fetch the collection.
|
void |
setTotalCount(Integer totalCount) |
void |
setURL(String url) |
equals, toStringpublic List<T> getData()
getData in interface StripeCollectionInterface<T extends HasId>public Integer getTotalCount()
getTotalCount in interface StripeCollectionInterface<T extends HasId>public void setTotalCount(Integer totalCount)
public Boolean getHasMore()
getHasMore in interface StripeCollectionInterface<T extends HasId>public void setHasMore(Boolean hasMore)
public String getURL()
getURL in interface StripeCollectionInterface<T extends HasId>public void setURL(String url)
public Integer getCount()
public void setCount(Integer count)
public Iterable<T> autoPagingIterable()
public RequestOptions getRequestOptions()
StripeCollectionInterfacegetRequestOptions in interface StripeCollectionInterface<T extends HasId>public Map<String,Object> getRequestParams()
StripeCollectionInterfacegetRequestParams in interface StripeCollectionInterface<T extends HasId>public void setRequestOptions(RequestOptions requestOptions)
StripeCollectionInterfacesetRequestOptions in interface StripeCollectionInterface<T extends HasId>public void setRequestParams(Map<String,Object> requestParams)
StripeCollectionInterfacesetRequestParams in interface StripeCollectionInterface<T extends HasId>Copyright © 2016 Stripe. All rights reserved.