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 -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleancom.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.getId()The context ID of the relationship.com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainerThe context ID of the parent entity associated with this asset.The context ID of theProductassociated with this asset.Whether the persistent counterpart to thisProductAssethas a non-default value forSortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven byProductAsset.inthashCode()booleanDetermines whether this asset should be considered the primary asset for theproduct.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.voidThe context ID of the relationship.voidsetOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) voidsetPrimary(boolean primary) Determines whether this asset should be considered the primary asset for theproduct.voidsetProductId(String productId) The context ID of theProductassociated with this asset.voidWhether the persistent counterpart to thisProductAssethas a non-default value forSortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven byProductAsset.toString()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
-
Constructor Details
-
ProductAsset
public ProductAsset()
-
-
Method Details
-
getParentId
Description copied from interface:PrimaryAssetThe context ID of the parent entity associated with this asset.- Specified by:
getParentIdin interfacePrimaryAsset- Returns:
- the context ID of the parent entity in the relationship
- See Also:
-
getId
The context ID of the relationship.- Specified by:
getIdin interfacePrimaryAsset- Returns:
- the context ID of the relationship
-
getProductId
The context ID of theProductassociated 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 theproduct.For any
product, there can only be oneProductAssetwith this value set to true.- Specified by:
isPrimaryin interfacePrimaryAsset- Returns:
- true if this asset should be the primary asset for the
product, false otherwise
-
getSorted
Whether the persistent counterpart to thisProductAssethas a non-default value forSortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven byProductAsset.- Specified by:
getSortedin interfacecom.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted- Returns:
- Whether the persistent counterpart to this
ProductAssethas a non-default value forSortable.getSorting(). - See Also:
-
Sorted.getSorted()Sortable
-
getContextState
public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()A subset ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation to expose the context state for this object
-
getOverrideChangeContainer
public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getOverrideChangeContainer()- Specified by:
getOverrideChangeContainerin interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
-
setId
The context ID of the relationship.- Parameters:
id- the context ID of the relationship
-
setProductId
The context ID of theProductassociated 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 theproduct.For any
product, there can only be oneProductAssetwith this value set to true.- Specified by:
setPrimaryin interfacePrimaryAsset- Parameters:
primary- true if this asset should be the primary asset for theproduct, false otherwise
-
setSorted
Whether the persistent counterpart to thisProductAssethas a non-default value forSortable.getSorting(), which determines order in admin list grids and ordering of images that appear in customer-facing frontend views that are driven byProductAsset.- Parameters:
sorted- Whether the persistent counterpart to thisProductAssethas a non-default value forSortable.getSorting().- See Also:
-
Sorted.getSorted()Sortable
-
setContextState
public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
setOverrideChangeContainer
public void setOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) - Specified by:
setOverrideChangeContainerin interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
-
toString
- Overrides:
toStringin classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
equals
- Overrides:
equalsin classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
canEqual
- Overrides:
canEqualin classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-