Interface ProductTypeDraft

All Superinterfaces:
Draft<ProductTypeDraft>, WithKey

public interface ProductTypeDraft extends WithKey, Draft<ProductTypeDraft>
ProductTypeDraft
Example to create an instance using the builder pattern

     ProductTypeDraft productTypeDraft = ProductTypeDraft.builder()
             .name("{name}")
             .description("{description}")
             .build()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier for the ProductType.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getName

      @NotNull @NotNull String getName()

      Name of the ProductType.

      Returns:
      name
    • getDescription

      @NotNull @NotNull String getDescription()

      Description of the ProductType.

      Returns:
      description
    • getAttributes

      @Valid @Valid List<AttributeDefinitionDraft> getAttributes()

      Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

      Returns:
      attributes
    • setKey

      void setKey(String key)

      User-defined unique identifier for the ProductType.

      Parameters:
      key - value to be set
    • setName

      void setName(String name)

      Name of the ProductType.

      Parameters:
      name - value to be set
    • setDescription

      void setDescription(String description)

      Description of the ProductType.

      Parameters:
      description - value to be set
    • setAttributes

      void setAttributes(AttributeDefinitionDraft... attributes)

      Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<AttributeDefinitionDraft> attributes)

      Attributes to specify for the ProductType. Products of this ProductType have these Attributes available on their ProductVariants.

      Parameters:
      attributes - values to be set
    • of

      static ProductTypeDraft of()
      factory method
      Returns:
      instance of ProductTypeDraft
    • of

      static ProductTypeDraft of(ProductTypeDraft template)
      factory method to create a shallow copy ProductTypeDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of ProductTypeDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductTypeDraftBuilder builder()
      builder factory method for ProductTypeDraft
      Returns:
      builder
    • builder

      static ProductTypeDraftBuilder builder(ProductTypeDraft template)
      create builder for ProductTypeDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductTypeDraft

      default <T> T withProductTypeDraft(Function<ProductTypeDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ProductTypeDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference