Package com.stripe.model
Class StripeCollection<T extends HasId>
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.model.StripeCollection<T>
-
- All Implemented Interfaces:
StripeCollectionInterface<T>
- Direct Known Subclasses:
AccountCollection
,ApplePayDomainCollection
,ApplicationFeeCollection
,AuthorizationCollection
,BalanceTransactionCollection
,BitcoinReceiverCollection
,BitcoinTransactionCollection
,CardCollection
,CardCollection
,CardholderCollection
,ChargeCollection
,CountrySpecCollection
,CouponCollection
,CustomerCollection
,DisputeCollection
,DisputeCollection
,EventCollection
,ExchangeRateCollection
,ExternalAccountCollection
,FeeRefundCollection
,FileCollection
,FileLinkCollection
,InvoiceCollection
,InvoiceItemCollection
,InvoiceLineItemCollection
,IssuerFraudRecordCollection
,LocationCollection
,OrderCollection
,OrderReturnCollection
,PaymentIntentCollection
,PaymentMethodCollection
,PaymentSourceCollection
,PayoutCollection
,PersonCollection
,PlanCollection
,ProductCollection
,ReaderCollection
,RecipientCollection
,RefundCollection
,ReportRunCollection
,ReportTypeCollection
,ReviewCollection
,ScheduledQueryRunCollection
,SkuCollection
,SourceTransactionCollection
,SubscriptionCollection
,SubscriptionItemCollection
,SubscriptionScheduleCollection
,SubscriptionScheduleRevisionCollection
,TopupCollection
,TransactionCollection
,TransferCollection
,TransferReversalCollection
,UsageRecordSummaryCollection
,ValueListCollection
,ValueListItemCollection
,WebhookEndpointCollection
public abstract class StripeCollection<T extends HasId> extends StripeObject implements StripeCollectionInterface<T>
Provides a representation of a single page worth of data from the Stripe API.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()); }
-
-
Field Summary
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description StripeCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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)
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
autoPagingIterable
public java.lang.Iterable<T> autoPagingIterable()
-
autoPagingIterable
public java.lang.Iterable<T> autoPagingIterable(java.util.Map<java.lang.String,java.lang.Object> params)
-
autoPagingIterable
public 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. As page boundaries are encountered, the next page will be fetched automatically for continued iteration.- Parameters:
params
- request parameters (will override the parameters from the initial list request)options
- request options (will override the options from the initial list request)
-
getObject
public java.lang.String getObject()
-
getCount
@Deprecated public java.lang.Long getCount()
Deprecated.Use pagination parameters instead.Thecount
attribute.- See Also:
- Pagination
-
setObject
public void setObject(java.lang.String object)
-
setData
public void setData(java.util.List<T> data)
-
setHasMore
public void setHasMore(java.lang.Boolean hasMore)
-
setTotalCount
public void setTotalCount(java.lang.Long totalCount)
-
setUrl
public void setUrl(java.lang.String url)
-
setCount
@Deprecated public void setCount(java.lang.Long count)
Deprecated.Use pagination parameters instead.Thecount
attribute.- See Also:
- Pagination
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getData
public java.util.List<T> getData()
- Specified by:
getData
in interfaceStripeCollectionInterface<T extends HasId>
-
getHasMore
public java.lang.Boolean getHasMore()
- Specified by:
getHasMore
in interfaceStripeCollectionInterface<T extends HasId>
-
getTotalCount
public java.lang.Long getTotalCount()
- Specified by:
getTotalCount
in interfaceStripeCollectionInterface<T extends HasId>
-
getUrl
public java.lang.String getUrl()
- Specified by:
getUrl
in interfaceStripeCollectionInterface<T extends HasId>
-
getRequestOptions
public RequestOptions getRequestOptions()
Description copied from interface:StripeCollectionInterface
Get request options that were used to fetch the collection. This is useful for purposes of pagination.- Specified by:
getRequestOptions
in interfaceStripeCollectionInterface<T extends HasId>
-
setRequestOptions
public void setRequestOptions(RequestOptions requestOptions)
Description copied from interface:StripeCollectionInterface
Set request options that were used to fetch the collection. This is required for purposes of pagination.- Specified by:
setRequestOptions
in interfaceStripeCollectionInterface<T extends HasId>
-
getRequestParams
public java.util.Map<java.lang.String,java.lang.Object> getRequestParams()
Description copied from interface:StripeCollectionInterface
Get request parameters that were used to fetch the collection. This is useful for purposes of pagination.- Specified by:
getRequestParams
in interfaceStripeCollectionInterface<T extends HasId>
-
setRequestParams
public void setRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Description copied from interface:StripeCollectionInterface
Set request parameters that were used to fetch the collection. This is required for purposes of pagination.- Specified by:
setRequestParams
in interfaceStripeCollectionInterface<T extends HasId>
-
-