Class MoneySetAttributeBuilder

java.lang.Object
com.commercetools.importapi.models.productvariants.MoneySetAttributeBuilder
All Implemented Interfaces:
Builder<MoneySetAttribute>

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

     MoneySetAttribute moneySetAttribute = MoneySetAttribute.builder()
             .plusValue(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • MoneySetAttributeBuilder

      public MoneySetAttributeBuilder()
  • Method Details

    • name

      The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.

      Parameters:
      name - value to be set
      Returns:
      Builder
    • value

      public MoneySetAttributeBuilder value(TypedMoney... value)
      set values to the value
      Parameters:
      value - value to be set
      Returns:
      Builder
    • value

      public MoneySetAttributeBuilder value(List<TypedMoney> value)
      set value to the value
      Parameters:
      value - value to be set
      Returns:
      Builder
    • plusValue

      public MoneySetAttributeBuilder plusValue(TypedMoney... value)
      add values to the value
      Parameters:
      value - value to be set
      Returns:
      Builder
    • plusValue

      public MoneySetAttributeBuilder plusValue(Function<TypedMoneyBuilder,Builder<? extends TypedMoney>> builder)
      add a value to the value using the builder function
      Parameters:
      builder - function to build the value value
      Returns:
      Builder
    • withValue

      public MoneySetAttributeBuilder withValue(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
    • getName

      @Nullable public String getName()

      The name of this attribute must match a name of the product types attribute definitions. The name is required if this type is used in a product variant and must not be set when used in a product variant patch.

      Returns:
      name
    • getValue

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

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

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

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

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