Class ProductAssignmentMissingErrorBuilder

java.lang.Object
com.commercetools.api.models.error.ProductAssignmentMissingErrorBuilder
All Implemented Interfaces:
Builder<ProductAssignmentMissingError>

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

     ProductAssignmentMissingError productAssignmentMissingError = ProductAssignmentMissingError.builder()
             .message("{message}")
             .product(productBuilder -> productBuilder)
             .build()
 
  • Constructor Details

    • ProductAssignmentMissingErrorBuilder

      public ProductAssignmentMissingErrorBuilder()
  • Method Details

    • message

      public ProductAssignmentMissingErrorBuilder message(String message)

      For Product Selection of mode Individual, the message is: "A Product Variant Selection can only be set for a Product that has previously been added to the Product Selection." For Product Selection of mode IndividualExclusion, the message is: "A Variant Exclusion can only be set for a Product that has previously been added to the Product Selection of type Individual Exclusion."

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

      Error-specific additional fields.

      Parameters:
      values - properties to be set
      Returns:
      Builder
    • addValue

      public ProductAssignmentMissingErrorBuilder addValue(String key, Object value)

      Error-specific additional fields.

      Parameters:
      key - property name
      value - property value
      Returns:
      Builder
    • product

      Reference to the Product for which the error was returned.

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

      Reference to the Product for which the error was returned.

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

      Reference to the Product for which the error was returned.

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

      public String getMessage()

      For Product Selection of mode Individual, the message is: "A Product Variant Selection can only be set for a Product that has previously been added to the Product Selection." For Product Selection of mode IndividualExclusion, the message is: "A Variant Exclusion can only be set for a Product that has previously been added to the Product Selection of type Individual Exclusion."

      Returns:
      message
    • getValues

      public Map<String,Object> getValues()

      Error-specific additional fields.

      Returns:
      pattern properties
    • getProduct

      public ProductReference getProduct()

      Reference to the Product for which the error was returned.

      Returns:
      product
    • build

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

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

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

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