Class CartAddPaymentActionBuilder
java.lang.Object
com.commercetools.api.models.cart.CartAddPaymentActionBuilder
- All Implemented Interfaces:
Builder<CartAddPaymentAction>
CartAddPaymentActionBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
CartAddPaymentAction cartAddPaymentAction = CartAddPaymentAction.builder()
.payment(paymentBuilder -> paymentBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds CartAddPaymentAction with checking for non-null required valuesbuilds CartAddPaymentAction without checking for non-null required valuesPayment to add to the Cart.static CartAddPaymentActionBuilder
of()
factory method for an instance of CartAddPaymentActionBuilderstatic CartAddPaymentActionBuilder
of
(CartAddPaymentAction template) create builder for CartAddPaymentAction instancepayment
(PaymentResourceIdentifier payment) Payment to add to the Cart.Payment to add to the Cart.Payment to add to the Cart.
-
Constructor Details
-
CartAddPaymentActionBuilder
public CartAddPaymentActionBuilder()
-
-
Method Details
-
payment
public CartAddPaymentActionBuilder payment(Function<PaymentResourceIdentifierBuilder, PaymentResourceIdentifierBuilder> builder) Payment to add to the Cart. Must not be assigned to another Order or active Cart already.
- Parameters:
builder
- function to build the payment value- Returns:
- Builder
-
withPayment
public CartAddPaymentActionBuilder withPayment(Function<PaymentResourceIdentifierBuilder, PaymentResourceIdentifier> builder) Payment to add to the Cart. Must not be assigned to another Order or active Cart already.
- Parameters:
builder
- function to build the payment value- Returns:
- Builder
-
payment
Payment to add to the Cart. Must not be assigned to another Order or active Cart already.
- Parameters:
payment
- value to be set- Returns:
- Builder
-
getPayment
Payment to add to the Cart. Must not be assigned to another Order or active Cart already.
- Returns:
- payment
-
build
builds CartAddPaymentAction with checking for non-null required values- Specified by:
build
in interfaceBuilder<CartAddPaymentAction>
- Returns:
- CartAddPaymentAction
-
buildUnchecked
builds CartAddPaymentAction without checking for non-null required values- Returns:
- CartAddPaymentAction
-
of
factory method for an instance of CartAddPaymentActionBuilder- Returns:
- builder
-
of
create builder for CartAddPaymentAction instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-