Class LiteVariant

java.lang.Object
com.broadleafcommerce.catalogbrowse.domain.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 Browse Service 2.2.0, Release Train 2.3.0
Author:
Susana Cruz (susanaccruz)
See Also:
  • Constructor Details

    • LiteVariant

      public LiteVariant()
  • Method Details

    • addAttribute

      public void addAttribute(String name, Object value)
      Takes in any additional attributes passed in the request not matching any defined properties.
      Parameters:
      name - Name of the additional attribute
      value - Value of the additional attribute
    • getAttributes

      public Map<String,Object> getAttributes()
      Return any additional attributes passed in the request not matching any defined properties.
      Returns:
      any additional attributes passed in the request not matching any defined properties.
    • getId

      public String getId()
      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()
      Map of option attribute names to a corresponding option value. This makes a particular variant uniquely identifiable across multiple variants for the same product.
      Returns:
      a map of option attribute names to a corresponding option value
    • getAvailabilitySummary

      public SkuInventoryAvailabilitySummary getAvailabilitySummary()
      High-level inventory availability details for the specific SKU of the variant.
      Returns:
      a summary of inventory availability for the specific SKU of the variant.
    • setId

      public void setId(String id)
      The unique identifier for this variant.
      Parameters:
      id - 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)
      Map of option attribute names to a corresponding option value. This makes a particular variant uniquely identifiable across multiple variants for the same product.
      Parameters:
      optionValues - a map of option attribute names to a corresponding option value
    • setAvailabilitySummary

      public void setAvailabilitySummary(SkuInventoryAvailabilitySummary availabilitySummary)
      High-level inventory availability details for the specific SKU of the variant.
      Parameters:
      availabilitySummary - a summary of inventory availability for the specific SKU of the variant.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Map holding any additional attributes passed in the request not matching any defined properties.
    • 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