Class GiftcardFields.Builder
- java.lang.Object
-
- com.cheetahdigital.corekit.rest.params.BaseParams.BaseBuilder<GiftcardFields,GiftcardFields.Builder>
-
- com.cheetahdigital.giftcards.core.api.GiftcardFields.Builder
-
- Enclosing class:
- GiftcardFields
public static class GiftcardFields.Builder extends BaseParams.BaseBuilder<GiftcardFields,GiftcardFields.Builder>
Builder class forGiftcardFields
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.corekit.rest.params.BaseParams.BaseBuilder
mQueryParams
-
-
Constructor Summary
Constructors Constructor Description Builder()
Default constructorBuilder(GiftcardFields queryParams)
Create a builder class from an existingGiftcardFields
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GiftcardFields
build()
protected GiftcardFields
createQueryParams()
Instantiates the implementation classGiftcardFields.Builder
setAmount(java.lang.Float amount)
Set the amount to use for purchase.GiftcardFields.Builder
setGiftcardClass(java.lang.String giftcardClass)
Set the class of the giftcard to be purchasedGiftcardFields.Builder
setIsAutoReload(java.lang.Boolean isAutoReload)
Set the flag to indicate if auto-reload is on or offGiftcardFields.Builder
setPaymentMethodNonce(java.lang.String paymentMethodNonce)
Sets the payment method nonce from BraintreeGiftcardFields.Builder
setPin(java.lang.String pin)
Set the PIN of gift cardGiftcardFields.Builder
setReloadAmount(java.lang.String reloadAmount)
Set the amount to add during auto-reloadGiftcardFields.Builder
setReloadThreshold(java.lang.String reloadThreshold)
Set the amount threshold to trigger auto-reload-
Methods inherited from class com.cheetahdigital.corekit.rest.params.BaseParams.BaseBuilder
setId
-
-
-
-
Constructor Detail
-
Builder
public Builder(GiftcardFields queryParams)
Create a builder class from an existingGiftcardFields
- Parameters:
queryParams
-GiftcardFields
to be reused
-
Builder
public Builder()
Default constructor
-
-
Method Detail
-
setPaymentMethodNonce
public GiftcardFields.Builder setPaymentMethodNonce(@NonNull java.lang.String paymentMethodNonce)
Sets the payment method nonce from Braintree- Parameters:
paymentMethodNonce
- payment method nonce from Braintree- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setAmount
public GiftcardFields.Builder setAmount(@Nullable java.lang.Float amount)
Set the amount to use for purchase. Use this when reloading a gift cardGiftcardsAPI.reloadGiftcard(GiftcardParams, GiftcardFields, ListenerModel)
- Parameters:
amount
- amount to load in gift card- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setPin
public GiftcardFields.Builder setPin(@NonNull java.lang.String pin)
Set the PIN of gift card- Parameters:
pin
- PIN of gift card- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setIsAutoReload
public GiftcardFields.Builder setIsAutoReload(@Nullable java.lang.Boolean isAutoReload)
Set the flag to indicate if auto-reload is on or off- Parameters:
isAutoReload
-true
to turn on auto reload- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setReloadThreshold
public GiftcardFields.Builder setReloadThreshold(@Nullable java.lang.String reloadThreshold)
Set the amount threshold to trigger auto-reload- Parameters:
reloadThreshold
- amount threshold to trigger auto-reload- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setReloadAmount
public GiftcardFields.Builder setReloadAmount(@Nullable java.lang.String reloadAmount)
Set the amount to add during auto-reload- Parameters:
reloadAmount
- amount to add during auto-reload- Returns:
- The Builder object to allow for chaining calls to set/add methods
-
setGiftcardClass
public GiftcardFields.Builder setGiftcardClass(java.lang.String giftcardClass)
Set the class of the giftcard to be purchased- Parameters:
giftcardClass
- internal name of the gift card class- Returns:
- The builder object to allow for chaining calls to set/add methods
-
createQueryParams
protected GiftcardFields createQueryParams()
Description copied from class:BaseParams.BaseBuilder
Instantiates the implementation class- Specified by:
createQueryParams
in classBaseParams.BaseBuilder<GiftcardFields,GiftcardFields.Builder>
- Returns:
- implementation class of
BaseParams.BaseBuilder
-
build
public GiftcardFields build()
- Overrides:
build
in classBaseParams.BaseBuilder<GiftcardFields,GiftcardFields.Builder>
- Returns:
- the built parameter class
-
-