Class ProductSelectionAssignmentBuilder

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

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

     ProductSelectionAssignment productSelectionAssignment = ProductSelectionAssignment.builder()
             .product(productBuilder -> productBuilder)
             .productSelection(productSelectionBuilder -> productSelectionBuilder)
             .build()
 
  • Constructor Details

    • ProductSelectionAssignmentBuilder

      public ProductSelectionAssignmentBuilder()
  • Method Details

    • product

      Reference to a Product that is assigned to the ProductSelection.

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

      Reference to a Product that is assigned to the ProductSelection.

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

      Reference to a Product that is assigned to the ProductSelection.

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

      Reference to the Product Selection that this assignment is part of.

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

      Reference to the Product Selection that this assignment is part of.

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

      public ProductSelectionAssignmentBuilder productSelection(ProductSelectionReference productSelection)

      Reference to the Product Selection that this assignment is part of.

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

      public ProductSelectionAssignmentBuilder variantSelection(@Nullable ProductVariantSelection variantSelection)

      Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

      This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

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

      Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

      This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

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

      Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

      This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

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

      Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

      This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

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

      public ProductSelectionAssignmentBuilder variantExclusion(@Nullable ProductVariantExclusion variantExclusion)

      Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

      This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

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

      public ProductReference getProduct()

      Reference to a Product that is assigned to the ProductSelection.

      Returns:
      product
    • getProductSelection

      public ProductSelectionReference getProductSelection()

      Reference to the Product Selection that this assignment is part of.

      Returns:
      productSelection
    • getVariantSelection

      @Nullable public ProductVariantSelection getVariantSelection()

      Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

      This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

      Returns:
      variantSelection
    • getVariantExclusion

      @Nullable public ProductVariantExclusion getVariantExclusion()

      Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

      This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

      Returns:
      variantExclusion
    • build

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

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

      factory method for an instance of ProductSelectionAssignmentBuilder
      Returns:
      builder
    • of

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