Interface Product

All Superinterfaces:
BaseResource, DomainResource<Product>, Identifiable<Product>, ProductMixin, Referencable<Product>, ResourceIdentifiable<Product>, Versioned<Product>, WithKey

An abstract sellable good with a set of Attributes defined by a Product Type. Products themselves are not sellable. Instead, they act as a parent structure for Product Variants. Each Product must have at least one Product Variant, which is called the Master Variant. A single Product representation contains the current and the staged representation of its product data.


Example to create an instance using the builder pattern

     Product product = Product.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .productType(productTypeBuilder -> productTypeBuilder)
             .masterData(masterDataBuilder -> masterDataBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Product.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<Product>
      Specified by:
      getId in interface Identifiable<Product>
      Specified by:
      getId in interface Versioned<Product>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Product.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<Product>
      Specified by:
      getVersion in interface Versioned<Product>
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Product was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Product was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Product.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the Product.

      Returns:
      createdBy
    • getKey

      String getKey()

      User-defined unique identifier of the Product.

      This is different from the key of a ProductVariant.

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

      @NotNull @Valid @NotNull @Valid ProductTypeReference getProductType()

      The Product Type defining the Attributes of the Product. Cannot be changed.

      Returns:
      productType
    • getMasterData

      @NotNull @Valid @NotNull @Valid ProductCatalogData getMasterData()

      Contains the current and the staged representation of the product information.

      Returns:
      masterData
    • getTaxCategory

      @Valid @Valid TaxCategoryReference getTaxCategory()

      The TaxCategory of the Product.

      Returns:
      taxCategory
    • getState

      @Valid @Valid StateReference getState()

      State of the Product.

      Returns:
      state
    • getReviewRatingStatistics

      @Valid @Valid ReviewRatingStatistics getReviewRatingStatistics()

      Review statistics of the Product.

      Returns:
      reviewRatingStatistics
    • getPriceMode

      ProductPriceModeEnum getPriceMode()

      Type of Price to be used when looking up a price for the Product.

      Returns:
      priceMode
    • getWarnings

      @Valid @Valid List<WarningObject> getWarnings()

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Returns:
      warnings
    • setId

      void setId(String id)

      Unique identifier of the Product.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Product.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Product was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Product was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Product.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the Product.

      Parameters:
      createdBy - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Product.

      This is different from the key of a ProductVariant.

      Parameters:
      key - value to be set
    • setProductType

      void setProductType(ProductTypeReference productType)

      The Product Type defining the Attributes of the Product. Cannot be changed.

      Parameters:
      productType - value to be set
    • setMasterData

      void setMasterData(ProductCatalogData masterData)

      Contains the current and the staged representation of the product information.

      Parameters:
      masterData - value to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryReference taxCategory)

      The TaxCategory of the Product.

      Parameters:
      taxCategory - value to be set
    • setState

      void setState(StateReference state)

      State of the Product.

      Parameters:
      state - value to be set
    • setReviewRatingStatistics

      void setReviewRatingStatistics(ReviewRatingStatistics reviewRatingStatistics)

      Review statistics of the Product.

      Parameters:
      reviewRatingStatistics - value to be set
    • setPriceMode

      void setPriceMode(ProductPriceModeEnum priceMode)

      Type of Price to be used when looking up a price for the Product.

      Parameters:
      priceMode - value to be set
    • setWarnings

      void setWarnings(WarningObject... warnings)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Parameters:
      warnings - values to be set
    • setWarnings

      void setWarnings(List<WarningObject> warnings)

      Warnings about processing of a request. Appears in response to requests with response status code 202 Accepted.

      Parameters:
      warnings - values to be set
    • of

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

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

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

      static ProductBuilder builder()
      builder factory method for Product
      Returns:
      builder
    • builder

      static ProductBuilder builder(Product template)
      create builder for Product instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withProduct

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

      static ReferenceTypeId referenceTypeId()
    • typeReference

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