Class DateAttributeBuilder

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

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

     DateAttribute dateAttribute = DateAttribute.builder()
             .value(LocalDate.parse("2022-01-01"))
             .build()
 
  • Constructor Details

    • DateAttributeBuilder

      public DateAttributeBuilder()
  • 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 DateAttributeBuilder value(LocalDate value)
      set the value to the value
      Parameters:
      value - value to be set
      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 LocalDate getValue()
      value of value}
      Returns:
      value
    • build

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

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

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

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