Interface VariantData


public interface VariantData

Contains the actual data for a Variant in either current (published) or staged (draft) state.


Example to create an instance using the builder pattern

     VariantData variantData = VariantData.builder()
             .build()
 
  • Method Details

    • getSku

      String getSku()

      User-defined unique SKU of the Variant.

      Returns:
      sku
    • getImages

      @Valid @Valid List<Image> getImages()

      Images of the Variant.

      Returns:
      images
    • getAttributes

      @Valid @Valid List<Attribute> getAttributes()

      Attributes of the Variant according to the respective AttributeDefinition.

      Returns:
      attributes
    • getAssets

      @Valid @Valid List<Asset> getAssets()

      Media assets of the Variant.

      Returns:
      assets
    • setSku

      void setSku(String sku)

      User-defined unique SKU of the Variant.

      Parameters:
      sku - value to be set
    • setImages

      void setImages(Image... images)

      Images of the Variant.

      Parameters:
      images - values to be set
    • setImages

      void setImages(List<Image> images)

      Images of the Variant.

      Parameters:
      images - values to be set
    • setAttributes

      void setAttributes(Attribute... attributes)

      Attributes of the Variant according to the respective AttributeDefinition.

      Parameters:
      attributes - values to be set
    • setAttributes

      void setAttributes(List<Attribute> attributes)

      Attributes of the Variant according to the respective AttributeDefinition.

      Parameters:
      attributes - values to be set
    • setAssets

      void setAssets(Asset... assets)

      Media assets of the Variant.

      Parameters:
      assets - values to be set
    • setAssets

      void setAssets(List<Asset> assets)

      Media assets of the Variant.

      Parameters:
      assets - values to be set
    • of

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

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

      VariantData copyDeep()
    • deepCopy

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

      static VariantDataBuilder builder()
      builder factory method for VariantData
      Returns:
      builder
    • builder

      static VariantDataBuilder builder(VariantData template)
      create builder for VariantData instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withVariantData

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

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