Class ProductAsset

java.lang.Object
com.broadleafcommerce.asset.consumer.domain.EntityAsset
com.broadleafcommerce.catalog.domain.asset.ProductAsset
All Implemented Interfaces:
com.broadleafcommerce.asset.consumer.domain.AssetSourceAware, PrimaryAsset, com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted, Serializable

public class ProductAsset extends com.broadleafcommerce.asset.consumer.domain.EntityAsset implements Serializable, PrimaryAsset, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable, com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
Represents a relationship between a Product and an Asset.
Author:
Samarth Dhruva (samarthd)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
    A subset of Tracking information to expose the context state for this object.
    The context ID of the relationship.
    com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer
     
    The context ID of the parent entity associated with this asset.
    The context ID of the Product associated with this asset.
    Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven by ProductAsset.
    int
     
    boolean
    Determines whether this asset should be considered the primary asset for the product.
    void
    setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
    A subset of Tracking information to expose the context state for this object.
    void
    The context ID of the relationship.
    void
    setOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer)
     
    void
    setPrimary(boolean primary)
    Determines whether this asset should be considered the primary asset for the product.
    void
    setProductId(String productId)
    The context ID of the Product associated with this asset.
    void
    Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven by ProductAsset.
     

    Methods inherited from class com.broadleafcommerce.asset.consumer.domain.EntityAsset

    getAltText, getApplicationId, getEmbedCode, getProvider, getTags, getTenantId, getTitle, getType, getUrl, setAltText, setApplicationId, setEmbedCode, setProvider, setTags, setTenantId, setTitle, setType, setUrl

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ProductAsset

      public ProductAsset()
  • Method Details

    • getParentId

      public String getParentId()
      Description copied from interface: PrimaryAsset
      The context ID of the parent entity associated with this asset.
      Specified by:
      getParentId in interface PrimaryAsset
      Returns:
      the context ID of the parent entity in the relationship
      See Also:
    • getId

      public String getId()
      The context ID of the relationship.
      Specified by:
      getId in interface PrimaryAsset
      Returns:
      the context ID of the relationship
    • getProductId

      public String getProductId()
      The context ID of the Product associated with this asset.
      Returns:
      the context ID of the product in the relationship
    • isPrimary

      public boolean isPrimary()
      Determines whether this asset should be considered the primary asset for the product.

      For any product, there can only be one ProductAsset with this value set to true.

      Specified by:
      isPrimary in interface PrimaryAsset
      Returns:
      true if this asset should be the primary asset for the product, false otherwise
    • getSorted

      public Boolean getSorted()
      Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven by ProductAsset.
      Specified by:
      getSorted in interface com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
      Returns:
      Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting().
      See Also:
      • Sorted.getSorted()
      • Sortable
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • getOverrideChangeContainer

      public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getOverrideChangeContainer()
      Specified by:
      getOverrideChangeContainer in interface com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
    • setId

      public void setId(String id)
      The context ID of the relationship.
      Parameters:
      id - the context ID of the relationship
    • setProductId

      public void setProductId(String productId)
      The context ID of the Product associated with this asset.
      Parameters:
      productId - the context ID of the product in the relationship
    • setPrimary

      public void setPrimary(boolean primary)
      Determines whether this asset should be considered the primary asset for the product.

      For any product, there can only be one ProductAsset with this value set to true.

      Specified by:
      setPrimary in interface PrimaryAsset
      Parameters:
      primary - true if this asset should be the primary asset for the product, false otherwise
    • setSorted

      public void setSorted(Boolean sorted)
      Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven by ProductAsset.
      Parameters:
      sorted - Whether the persistent counterpart to this ProductAsset has a non-default value for Sortable.getSorting().
      See Also:
      • Sorted.getSorted()
      • Sortable
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • setOverrideChangeContainer

      public void setOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer)
      Specified by:
      setOverrideChangeContainer in interface com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
    • toString

      public String toString()
      Overrides:
      toString in class com.broadleafcommerce.asset.consumer.domain.EntityAsset
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class com.broadleafcommerce.asset.consumer.domain.EntityAsset
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class com.broadleafcommerce.asset.consumer.domain.EntityAsset
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class com.broadleafcommerce.asset.consumer.domain.EntityAsset