Package com.stripe.param
Class PriceCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.PriceCreateParams.Builder
-
- Enclosing class:
- PriceCreateParams
public static class PriceCreateParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PriceCreateParams.Builder
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.PriceCreateParams.Builder
addAllTier(java.util.List<PriceCreateParams.Tier> elements)
Add all elements to `tiers` list.PriceCreateParams.Builder
addExpand(java.lang.String element)
Add an element to `expand` list.PriceCreateParams.Builder
addTier(PriceCreateParams.Tier element)
Add an element to `tiers` list.PriceCreateParams
build()
Finalize and obtain parameter instance from this builder.PriceCreateParams.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.PriceCreateParams.Builder
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.PriceCreateParams.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.PriceCreateParams.Builder
putMetadata(java.lang.String key, java.lang.String value)
Add a key/value pair to `metadata` map.PriceCreateParams.Builder
setActive(java.lang.Boolean active)
Whether the price can be used for new purchases.PriceCreateParams.Builder
setBillingScheme(PriceCreateParams.BillingScheme billingScheme)
Describes how to compute the price per period.PriceCreateParams.Builder
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.PriceCreateParams.Builder
setLookupKey(java.lang.String lookupKey)
A lookup key used to retrieve prices dynamically from a static string.PriceCreateParams.Builder
setNickname(java.lang.String nickname)
A brief description of the price, hidden from customers.PriceCreateParams.Builder
setProduct(java.lang.String product)
The ID of the product that this price will belong to.PriceCreateParams.Builder
setProductData(PriceCreateParams.ProductData productData)
These fields can be used to create a new product that this price will belong to.PriceCreateParams.Builder
setRecurring(PriceCreateParams.Recurring recurring)
The recurring components of a price such asinterval
andusage_type
.PriceCreateParams.Builder
setTiersMode(PriceCreateParams.TiersMode tiersMode)
Defines if the tiering price should begraduated
orvolume
based.PriceCreateParams.Builder
setTransferLookupKey(java.lang.Boolean transferLookupKey)
If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.PriceCreateParams.Builder
setTransformQuantity(PriceCreateParams.TransformQuantity transformQuantity)
Apply a transformation to the reported usage or set quantity before computing the billed price.PriceCreateParams.Builder
setUnitAmount(java.lang.Long unitAmount)
A positive integer in %s (or 0 for a free price) representing how much to charge.PriceCreateParams.Builder
setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount
, but accepts a decimal value in %s with at most 12 decimal places.
-
-
-
Method Detail
-
build
public PriceCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setActive
public PriceCreateParams.Builder setActive(java.lang.Boolean active)
Whether the price can be used for new purchases. Defaults totrue
.
-
setBillingScheme
public PriceCreateParams.Builder setBillingScheme(PriceCreateParams.BillingScheme billingScheme)
Describes how to compute the price per period. Eitherper_unit
ortiered
.per_unit
indicates that the fixed amount (specified inunit_amount
orunit_amount_decimal
) will be charged per unit inquantity
(for prices withusage_type=licensed
), or per unit of total usage (for prices withusage_type=metered
).tiered
indicates that the unit pricing will be computed using a tiering strategy as defined using thetiers
andtiers_mode
attributes.
-
setCurrency
public PriceCreateParams.Builder setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
addExpand
public PriceCreateParams.Builder addExpand(java.lang.String element)
Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePriceCreateParams.expand
for the field documentation.
-
addAllExpand
public PriceCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePriceCreateParams.expand
for the field documentation.
-
putExtraParam
public PriceCreateParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePriceCreateParams.extraParams
for the field documentation.
-
putAllExtraParam
public PriceCreateParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePriceCreateParams.extraParams
for the field documentation.
-
setLookupKey
public PriceCreateParams.Builder setLookupKey(java.lang.String lookupKey)
A lookup key used to retrieve prices dynamically from a static string.
-
putMetadata
public PriceCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePriceCreateParams.metadata
for the field documentation.
-
putAllMetadata
public PriceCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeePriceCreateParams.metadata
for the field documentation.
-
setNickname
public PriceCreateParams.Builder setNickname(java.lang.String nickname)
A brief description of the price, hidden from customers.
-
setProduct
public PriceCreateParams.Builder setProduct(java.lang.String product)
The ID of the product that this price will belong to.
-
setProductData
public PriceCreateParams.Builder setProductData(PriceCreateParams.ProductData productData)
These fields can be used to create a new product that this price will belong to.
-
setRecurring
public PriceCreateParams.Builder setRecurring(PriceCreateParams.Recurring recurring)
The recurring components of a price such asinterval
andusage_type
.
-
addTier
public PriceCreateParams.Builder addTier(PriceCreateParams.Tier element)
Add an element to `tiers` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePriceCreateParams.tiers
for the field documentation.
-
addAllTier
public PriceCreateParams.Builder addAllTier(java.util.List<PriceCreateParams.Tier> elements)
Add all elements to `tiers` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeePriceCreateParams.tiers
for the field documentation.
-
setTiersMode
public PriceCreateParams.Builder setTiersMode(PriceCreateParams.TiersMode tiersMode)
Defines if the tiering price should begraduated
orvolume
based. Involume
-based tiering, the maximum quantity within a period determines the per unit price, ingraduated
tiering pricing can successively change as the quantity grows.
-
setTransferLookupKey
public PriceCreateParams.Builder setTransferLookupKey(java.lang.Boolean transferLookupKey)
If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.
-
setTransformQuantity
public PriceCreateParams.Builder setTransformQuantity(PriceCreateParams.TransformQuantity transformQuantity)
Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined withtiers
.
-
setUnitAmount
public PriceCreateParams.Builder setUnitAmount(java.lang.Long unitAmount)
A positive integer in %s (or 0 for a free price) representing how much to charge.
-
setUnitAmountDecimal
public PriceCreateParams.Builder setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount
, but accepts a decimal value in %s with at most 12 decimal places. Only one ofunit_amount
andunit_amount_decimal
can be set.
-
-