Class ReferenceAttributeBuilder

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

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

     ReferenceAttribute referenceAttribute = ReferenceAttribute.builder()
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Constructor Details

    • ReferenceAttributeBuilder

      public ReferenceAttributeBuilder()
  • 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

      References a resource by key.

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

      References a resource by key.

      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 KeyReference getValue()

      References a resource by key.

      Returns:
      value
    • build

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

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

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

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