Class MoneyFieldBuilder

java.lang.Object
com.commercetools.importapi.models.customfields.MoneyFieldBuilder
All Implemented Interfaces:
Builder<MoneyField>

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

     MoneyField moneyField = MoneyField.builder()
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • MoneyFieldBuilder

      public MoneyFieldBuilder()
  • Method Details

    • value

      public MoneyFieldBuilder value(TypedMoney value)
      set the value to the value
      Parameters:
      value - value to be set
      Returns:
      Builder
    • value

      public MoneyFieldBuilder value(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)
      set the value to the value using the builder function
      Parameters:
      builder - function to build the value value
      Returns:
      Builder
    • getValue

      public TypedMoney getValue()
      value of value}
      Returns:
      value
    • build

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

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

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

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