Class MoneyAttributeBuilder

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

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

     MoneyAttribute moneyAttribute = MoneyAttribute.builder()
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • MoneyAttributeBuilder

      public MoneyAttributeBuilder()
  • 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 MoneyAttributeBuilder value(TypedMoney value)
      set the value to the value
      Parameters:
      value - value to be set
      Returns:
      Builder
    • value

      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 TypedMoney getValue()
      value of value}
      Returns:
      value
    • build

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

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

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

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