Class PaymentLabelBuilder
java.lang.Object
com.commercetools.history.models.label.PaymentLabelBuilder
- All Implemented Interfaces:
Builder<PaymentLabel>
PaymentLabelBuilder
Example to create an instance using the builder pattern
Example to create an instance using the builder pattern
PaymentLabel paymentLabel = PaymentLabel.builder()
.key("{key}")
.amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionamountPlanned
(Money amountPlanned) Money value the Payment intends to receive from the Customer.amountPlanned
(Function<MoneyBuilder, MoneyBuilder> builder) Money value the Payment intends to receive from the Customer.build()
builds PaymentLabel with checking for non-null required valuesbuilds PaymentLabel without checking for non-null required valuesMoney value the Payment intends to receive from the Customer.getKey()
User-defined unique identifier of the Payment.User-defined unique identifier of the Payment.static PaymentLabelBuilder
of()
factory method for an instance of PaymentLabelBuilderstatic PaymentLabelBuilder
of
(PaymentLabel template) create builder for PaymentLabel instancewithAmountPlanned
(Function<MoneyBuilder, Money> builder) Money value the Payment intends to receive from the Customer.
-
Constructor Details
-
PaymentLabelBuilder
public PaymentLabelBuilder()
-
-
Method Details
-
key
User-defined unique identifier of the Payment.
- Parameters:
key
- value to be set- Returns:
- Builder
-
amountPlanned
Money value the Payment intends to receive from the Customer.
- Parameters:
builder
- function to build the amountPlanned value- Returns:
- Builder
-
withAmountPlanned
Money value the Payment intends to receive from the Customer.
- Parameters:
builder
- function to build the amountPlanned value- Returns:
- Builder
-
amountPlanned
Money value the Payment intends to receive from the Customer.
- Parameters:
amountPlanned
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier of the Payment.
- Returns:
- key
-
getAmountPlanned
Money value the Payment intends to receive from the Customer.
- Returns:
- amountPlanned
-
build
builds PaymentLabel with checking for non-null required values- Specified by:
build
in interfaceBuilder<PaymentLabel>
- Returns:
- PaymentLabel
-
buildUnchecked
builds PaymentLabel without checking for non-null required values- Returns:
- PaymentLabel
-
of
factory method for an instance of PaymentLabelBuilder- Returns:
- builder
-
of
create builder for PaymentLabel instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-