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>,StripeObjectInterface
- Direct Known Subclasses:
AccountCollection,ApplePayDomainCollection,ApplicationFeeCollection,AuthorizationCollection,BalanceTransactionCollection,BitcoinReceiverCollection,BitcoinTransactionCollection,CapabilityCollection,CardCollection,CardCollection,CardholderCollection,ChargeCollection,ConfigurationCollection,CountrySpecCollection,CouponCollection,CreditNoteCollection,CreditNoteLineItemCollection,CustomerBalanceTransactionCollection,CustomerCollection,DisputeCollection,DisputeCollection,EarlyFraudWarningCollection,EventCollection,ExchangeRateCollection,ExternalAccountCollection,FeeRefundCollection,FileCollection,FileLinkCollection,InvoiceCollection,InvoiceItemCollection,InvoiceLineItemCollection,IssuerFraudRecordCollection,LineItemCollection,LocationCollection,OrderCollection,OrderReturnCollection,PaymentIntentCollection,PaymentMethodCollection,PaymentSourceCollection,PayoutCollection,PersonCollection,PlanCollection,PriceCollection,ProductCollection,PromotionCodeCollection,ReaderCollection,RecipientCollection,RefundCollection,ReportRunCollection,ReportTypeCollection,ReviewCollection,ScheduledQueryRunCollection,SessionCollection,SetupAttemptCollection,SetupIntentCollection,SkuCollection,SourceTransactionCollection,SubscriptionCollection,SubscriptionItemCollection,SubscriptionScheduleCollection,TaxCodeCollection,TaxIdCollection,TaxRateCollection,TopupCollection,TransactionCollection,TransferCollection,TransferReversalCollection,UsageRecordSummaryCollection,ValueListCollection,ValueListItemCollection,VerificationReportCollection,VerificationSessionCollection,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 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 booleancanEqual(java.lang.Object other)booleanequals(java.lang.Object o)java.util.List<T>getData()java.lang.BooleangetHasMore()java.lang.StringgetObject()RequestOptionsgetRequestOptions()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.StringgetUrl()inthashCode()voidsetData(java.util.List<T> data)voidsetHasMore(java.lang.Boolean hasMore)voidsetObject(java.lang.String object)voidsetRequestOptions(RequestOptions requestOptions)Set request options that were used to fetch the collection.voidsetRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)Set request parameters that were used to fetch the collection.voidsetUrl(java.lang.String url)-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.stripe.model.StripeObjectInterface
getLastResponse, setLastResponse
-
-
-
-
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()
-
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)
-
setUrl
public void setUrl(java.lang.String url)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getData
public java.util.List<T> getData()
- Specified by:
getDatain interfaceStripeCollectionInterface<T extends HasId>
-
getHasMore
public java.lang.Boolean getHasMore()
- Specified by:
getHasMorein interfaceStripeCollectionInterface<T extends HasId>
-
getUrl
public java.lang.String getUrl()
- Specified by:
getUrlin interfaceStripeCollectionInterface<T extends HasId>
-
getRequestOptions
public RequestOptions getRequestOptions()
Description copied from interface:StripeCollectionInterfaceGet request options that were used to fetch the collection. This is useful for purposes of pagination.- Specified by:
getRequestOptionsin interfaceStripeCollectionInterface<T extends HasId>
-
setRequestOptions
public void setRequestOptions(RequestOptions requestOptions)
Description copied from interface:StripeCollectionInterfaceSet request options that were used to fetch the collection. This is required for purposes of pagination.- Specified by:
setRequestOptionsin interfaceStripeCollectionInterface<T extends HasId>
-
getRequestParams
public java.util.Map<java.lang.String,java.lang.Object> getRequestParams()
Description copied from interface:StripeCollectionInterfaceGet request parameters that were used to fetch the collection. This is useful for purposes of pagination.- Specified by:
getRequestParamsin interfaceStripeCollectionInterface<T extends HasId>
-
setRequestParams
public void setRequestParams(java.util.Map<java.lang.String,java.lang.Object> requestParams)
Description copied from interface:StripeCollectionInterfaceSet request parameters that were used to fetch the collection. This is required for purposes of pagination.- Specified by:
setRequestParamsin interfaceStripeCollectionInterface<T extends HasId>
-
-