Class PaymentLabelBuilder

java.lang.Object
com.commercetools.history.models.label.PaymentLabelBuilder
All Implemented Interfaces:
Builder<PaymentLabel>

public class PaymentLabelBuilder extends Object implements Builder<PaymentLabel>
PaymentLabelBuilder
Example to create an instance using the builder pattern

     PaymentLabel paymentLabel = PaymentLabel.builder()
             .key("{key}")
             .amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
             .build()
 
  • Constructor Details

    • PaymentLabelBuilder

      public PaymentLabelBuilder()
  • Method Details

    • key

      public PaymentLabelBuilder key(String key)

      User-defined unique identifier of the Payment.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • amountPlanned

      public PaymentLabelBuilder amountPlanned(Function<MoneyBuilder,MoneyBuilder> builder)

      Money value the Payment intends to receive from the Customer.

      Parameters:
      builder - function to build the amountPlanned value
      Returns:
      Builder
    • withAmountPlanned

      public PaymentLabelBuilder withAmountPlanned(Function<MoneyBuilder,Money> builder)

      Money value the Payment intends to receive from the Customer.

      Parameters:
      builder - function to build the amountPlanned value
      Returns:
      Builder
    • amountPlanned

      public PaymentLabelBuilder amountPlanned(Money amountPlanned)

      Money value the Payment intends to receive from the Customer.

      Parameters:
      amountPlanned - value to be set
      Returns:
      Builder
    • getKey

      public String getKey()

      User-defined unique identifier of the Payment.

      Returns:
      key
    • getAmountPlanned

      public Money getAmountPlanned()

      Money value the Payment intends to receive from the Customer.

      Returns:
      amountPlanned
    • build

      public PaymentLabel build()
      builds PaymentLabel with checking for non-null required values
      Specified by:
      build in interface Builder<PaymentLabel>
      Returns:
      PaymentLabel
    • buildUnchecked

      public PaymentLabel buildUnchecked()
      builds PaymentLabel without checking for non-null required values
      Returns:
      PaymentLabel
    • of

      public static PaymentLabelBuilder of()
      factory method for an instance of PaymentLabelBuilder
      Returns:
      builder
    • of

      public static PaymentLabelBuilder of(PaymentLabel template)
      create builder for PaymentLabel instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder