Interface ProductData

All Superinterfaces:
MetaAttributes, ProductDataLike, WithLocalizedSlug

public interface ProductData extends ProductDataLike

Contains all the data of a Product and its Product Variants.


Example to create an instance using the builder pattern

     ProductData productData = ProductData.builder()
             .name(nameBuilder -> nameBuilder)
             .plusCategories(categoriesBuilder -> categoriesBuilder)
             .slug(slugBuilder -> slugBuilder)
             .masterVariant(masterVariantBuilder -> masterVariantBuilder)
             .plusVariants(variantsBuilder -> variantsBuilder)
             .searchKeywords(searchKeywordsBuilder -> searchKeywordsBuilder)
             .build()
 
  • Method Details

    • getName

      @NotNull @Valid @NotNull @Valid LocalizedString getName()

      Name of the Product.

      Specified by:
      getName in interface ProductDataLike
      Returns:
      name
    • getCategories

      @NotNull @Valid @NotNull @Valid List<CategoryReference> getCategories()

      Categories assigned to the Product.

      Specified by:
      getCategories in interface ProductDataLike
      Returns:
      categories
    • getCategoryOrderHints

      @Valid @Valid CategoryOrderHints getCategoryOrderHints()

      Numerical values to allow ordering of Products within a specified Category.

      Specified by:
      getCategoryOrderHints in interface ProductDataLike
      Returns:
      categoryOrderHints
    • getDescription

      @Valid @Valid LocalizedString getDescription()

      Description of the Product.

      Specified by:
      getDescription in interface ProductDataLike
      Returns:
      description
    • getSlug

      @NotNull @Valid @NotNull @Valid LocalizedString getSlug()

      User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different Locales. Matches the pattern [a-zA-Z0-9_\\-]{2,256}.

      Specified by:
      getSlug in interface ProductDataLike
      Specified by:
      getSlug in interface WithLocalizedSlug
      Returns:
      slug
    • getMetaTitle

      @Valid @Valid LocalizedString getMetaTitle()

      Title of the Product as used by search engines.

      Specified by:
      getMetaTitle in interface MetaAttributes
      Specified by:
      getMetaTitle in interface ProductDataLike
      Returns:
      metaTitle
    • getMetaDescription

      @Valid @Valid LocalizedString getMetaDescription()

      Description of the Product as used by search engines.

      Specified by:
      getMetaDescription in interface MetaAttributes
      Specified by:
      getMetaDescription in interface ProductDataLike
      Returns:
      metaDescription
    • getMetaKeywords

      @Valid @Valid LocalizedString getMetaKeywords()

      Keywords that give additional information about the Product to search engines.

      Specified by:
      getMetaKeywords in interface MetaAttributes
      Specified by:
      getMetaKeywords in interface ProductDataLike
      Returns:
      metaKeywords
    • getMasterVariant

      @NotNull @Valid @NotNull @Valid ProductVariant getMasterVariant()

      The Master Variant of the Product.

      Specified by:
      getMasterVariant in interface ProductDataLike
      Returns:
      masterVariant
      See Also:
    • getVariants

      @NotNull @Valid @NotNull @Valid List<ProductVariant> getVariants()

      Additional Product Variants.

      Specified by:
      getVariants in interface ProductDataLike
      Returns:
      variants
      See Also:
    • getSearchKeywords

      @NotNull @Valid @NotNull @Valid SearchKeywords getSearchKeywords()

      Used by Product Suggestions, but is also considered for a full text search.

      Specified by:
      getSearchKeywords in interface ProductDataLike
      Returns:
      searchKeywords
    • setName

      void setName(LocalizedString name)

      Name of the Product.

      Parameters:
      name - value to be set
    • setCategories

      void setCategories(CategoryReference... categories)

      Categories assigned to the Product.

      Parameters:
      categories - values to be set
    • setCategories

      void setCategories(List<CategoryReference> categories)

      Categories assigned to the Product.

      Parameters:
      categories - values to be set
    • setCategoryOrderHints

      void setCategoryOrderHints(CategoryOrderHints categoryOrderHints)

      Numerical values to allow ordering of Products within a specified Category.

      Parameters:
      categoryOrderHints - value to be set
    • setDescription

      void setDescription(LocalizedString description)

      Description of the Product.

      Parameters:
      description - value to be set
    • setSlug

      void setSlug(LocalizedString slug)

      User-defined identifier used in a deep-link URL for the Product. Must be unique across a Project, but can be the same for Products in different Locales. Matches the pattern [a-zA-Z0-9_\\-]{2,256}.

      Parameters:
      slug - value to be set
    • setMetaTitle

      void setMetaTitle(LocalizedString metaTitle)

      Title of the Product as used by search engines.

      Parameters:
      metaTitle - value to be set
    • setMetaDescription

      void setMetaDescription(LocalizedString metaDescription)

      Description of the Product as used by search engines.

      Parameters:
      metaDescription - value to be set
    • setMetaKeywords

      void setMetaKeywords(LocalizedString metaKeywords)

      Keywords that give additional information about the Product to search engines.

      Parameters:
      metaKeywords - value to be set
    • setMasterVariant

      void setMasterVariant(ProductVariant masterVariant)

      The Master Variant of the Product.

      Parameters:
      masterVariant - value to be set
    • setVariants

      void setVariants(ProductVariant... variants)

      Additional Product Variants.

      Parameters:
      variants - values to be set
    • setVariants

      void setVariants(List<ProductVariant> variants)

      Additional Product Variants.

      Parameters:
      variants - values to be set
    • setSearchKeywords

      void setSearchKeywords(SearchKeywords searchKeywords)

      Used by Product Suggestions, but is also considered for a full text search.

      Parameters:
      searchKeywords - value to be set
    • of

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

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

      @Nullable static ProductData deepCopy(@Nullable ProductData template)
      factory method to create a deep copy of ProductData
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ProductDataBuilder builder()
      builder factory method for ProductData
      Returns:
      builder
    • builder

      static ProductDataBuilder builder(ProductData template)
      create builder for ProductData instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProductData

      default <T> T withProductData(Function<ProductData,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<ProductData> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference