Class PaymentInfoBuilder

java.lang.Object
com.commercetools.history.models.common.PaymentInfoBuilder
All Implemented Interfaces:
Builder<PaymentInfo>

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

     PaymentInfo paymentInfo = PaymentInfo.builder()
             .plusPayments(paymentsBuilder -> paymentsBuilder)
             .build()
 
  • Constructor Details

    • PaymentInfoBuilder

      public PaymentInfoBuilder()
  • Method Details

    • payments

      public PaymentInfoBuilder payments(Reference... payments)
      set values to the payments
      Parameters:
      payments - value to be set
      Returns:
      Builder
    • payments

      public PaymentInfoBuilder payments(List<Reference> payments)
      set value to the payments
      Parameters:
      payments - value to be set
      Returns:
      Builder
    • plusPayments

      public PaymentInfoBuilder plusPayments(Reference... payments)
      add values to the payments
      Parameters:
      payments - value to be set
      Returns:
      Builder
    • plusPayments

      add the value to the payments using the builder function
      Parameters:
      builder - function to build the payments value
      Returns:
      Builder
    • withPayments

      set the value to the payments using the builder function
      Parameters:
      builder - function to build the payments value
      Returns:
      Builder
    • addPayments

      public PaymentInfoBuilder addPayments(Function<ReferenceBuilder,Reference> builder)
      add the value to the payments using the builder function
      Parameters:
      builder - function to build the payments value
      Returns:
      Builder
    • setPayments

      public PaymentInfoBuilder setPayments(Function<ReferenceBuilder,Reference> builder)
      set the value to the payments using the builder function
      Parameters:
      builder - function to build the payments value
      Returns:
      Builder
    • getPayments

      public List<Reference> getPayments()
      value of payments}
      Returns:
      payments
    • build

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

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

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

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