Class AssignedProductReferenceBuilder

java.lang.Object
com.commercetools.api.models.product_selection.AssignedProductReferenceBuilder
All Implemented Interfaces:
Builder<AssignedProductReference>

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

     AssignedProductReference assignedProductReference = AssignedProductReference.builder()
             .product(productBuilder -> productBuilder)
             .build()
 
  • Constructor Details

    • AssignedProductReferenceBuilder

      public AssignedProductReferenceBuilder()
  • Method Details

    • product

      Reference to a Product that is assigned to the Product Selection.

      Parameters:
      builder - function to build the product value
      Returns:
      Builder
    • withProduct

      Reference to a Product that is assigned to the Product Selection.

      Parameters:
      builder - function to build the product value
      Returns:
      Builder
    • product

      Reference to a Product that is assigned to the Product Selection.

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

      public AssignedProductReferenceBuilder variantSelection(@Nullable ProductVariantSelection variantSelection)

      The Variants of the Product that are included from the Product Selection.

      This field may exist only in Product Selections with Individual ProductSelectionMode. In absence of this field, all Variants are deemed to be included.

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

      The Variants of the Product that are included from the Product Selection.

      This field may exist only in Product Selections with Individual ProductSelectionMode. In absence of this field, all Variants are deemed to be included.

      Parameters:
      builder - function to build the variantSelection value
      Returns:
      Builder
    • variantExclusion

      The Variants of the Product that are excluded from the Product Selection.

      This field may exist only in Product Selections with IndividualExclusion ProductSelectionMode. In absence of this field, all Variants are deemed to be excluded.

      Parameters:
      builder - function to build the variantExclusion value
      Returns:
      Builder
    • withVariantExclusion

      The Variants of the Product that are excluded from the Product Selection.

      This field may exist only in Product Selections with IndividualExclusion ProductSelectionMode. In absence of this field, all Variants are deemed to be excluded.

      Parameters:
      builder - function to build the variantExclusion value
      Returns:
      Builder
    • variantExclusion

      public AssignedProductReferenceBuilder variantExclusion(@Nullable ProductVariantExclusion variantExclusion)

      The Variants of the Product that are excluded from the Product Selection.

      This field may exist only in Product Selections with IndividualExclusion ProductSelectionMode. In absence of this field, all Variants are deemed to be excluded.

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

      public ProductReference getProduct()

      Reference to a Product that is assigned to the Product Selection.

      Returns:
      product
    • getVariantSelection

      @Nullable public ProductVariantSelection getVariantSelection()

      The Variants of the Product that are included from the Product Selection.

      This field may exist only in Product Selections with Individual ProductSelectionMode. In absence of this field, all Variants are deemed to be included.

      Returns:
      variantSelection
    • getVariantExclusion

      @Nullable public ProductVariantExclusion getVariantExclusion()

      The Variants of the Product that are excluded from the Product Selection.

      This field may exist only in Product Selections with IndividualExclusion ProductSelectionMode. In absence of this field, all Variants are deemed to be excluded.

      Returns:
      variantExclusion
    • build

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

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

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

      create builder for AssignedProductReference instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder