java.lang.Object
com.broadleafcommerce.catalog.domain.product.LiteVariant
All Implemented Interfaces:
Serializable

public class LiteVariant extends Object implements Serializable
A lightweight version of Variant. This is intended for usage in commerce flows where only a small subset of data is necessary from the variant. This is used to improve performance and reduce payload size to the frontend.
Since:
Catalog Service 2.3.0, Release Train 2.3.0
Author:
Susana Cruz (susanaccruz)
See Also:
  • Constructor Details

  • Method Details

    • getContextId

      public String getContextId()
      The unique identifier for this variant.
      Returns:
      the context ID of the variant
    • getProductId

      public String getProductId()
      The link to the product that this variant is associated with
      Returns:
      the context ID of the product that this variant is associated with
    • getSku

      public String getSku()
      SKU code for this particular variant.
      Returns:
      the SKU code for this variant
    • getOptionValues

      public Map<String,String> getOptionValues()
      Helper to make this particular variant uniquely identifiable across multiple variants for the same product. Keys correspond to AttributeChoice.getAttributeName() while values correspond to one of the corresponding AttributeChoice.getAllowedValues().
      Returns:
      a map of option attribute names to a corresponding option value
    • setContextId

      public void setContextId(String contextId)
      The unique identifier for this variant.
      Parameters:
      contextId - the context ID of the variant
    • setProductId

      public void setProductId(String productId)
      The link to the product that this variant is associated with
      Parameters:
      productId - the context ID of the product that this variant is associated with
    • setSku

      public void setSku(String sku)
      SKU code for this particular variant.
      Parameters:
      sku - the SKU code for this variant
    • setOptionValues

      public void setOptionValues(Map<String,String> optionValues)
      Helper to make this particular variant uniquely identifiable across multiple variants for the same product. Keys correspond to AttributeChoice.getAttributeName() while values correspond to one of the corresponding AttributeChoice.getAllowedValues().
      Parameters:
      optionValues - a map of option attribute names to a corresponding option value
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object