Class CategoryAsset
java.lang.Object
com.broadleafcommerce.asset.consumer.domain.EntityAsset
com.broadleafcommerce.catalog.domain.asset.CategoryAsset
- All Implemented Interfaces:
com.broadleafcommerce.asset.consumer.domain.AssetSourceAware
,PrimaryAsset
,com.broadleafcommerce.data.tracking.core.ContextStateAware
,com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
,Serializable
public class CategoryAsset
extends com.broadleafcommerce.asset.consumer.domain.EntityAsset
implements Serializable, PrimaryAsset, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
Represents a relationship between a
Category
and an Asset
.- Author:
- Samarth Dhruva (samarthd)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The context ID of theCategory
associated with this asset.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.getId()
The context ID of the relationship.The context ID of the parent entity associated with this asset.Whether the persistent counterpart to thisCategoryAsset
has 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 byCategoryAsset
.int
hashCode()
boolean
Determines whether this asset should be considered the primary asset for thecategory
.void
setCategoryId
(String categoryId) The context ID of theCategory
associated with this asset.void
setContextState
(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState) A subset ofTracking
information to expose the context state for this object.void
The context ID of the relationship.void
setPrimary
(boolean primary) Determines whether this asset should be considered the primary asset for thecategory
.void
Whether the persistent counterpart to thisCategoryAsset
has 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 byCategoryAsset
.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
-
CategoryAsset
public CategoryAsset()
-
-
Method Details
-
getParentId
Description copied from interface:PrimaryAsset
The context ID of the parent entity associated with this asset.- Specified by:
getParentId
in interfacePrimaryAsset
- Returns:
- the context ID of the parent entity in the relationship
- See Also:
-
getId
The context ID of the relationship.- Specified by:
getId
in interfacePrimaryAsset
- Returns:
- the context ID of the relationship
-
getCategoryId
The context ID of theCategory
associated with this asset.- Returns:
- the context ID of the category in the relationship
-
isPrimary
public boolean isPrimary()Determines whether this asset should be considered the primary asset for thecategory
.For any
category
, there can only be oneCategoryAsset
with this value set to true.- Specified by:
isPrimary
in interfacePrimaryAsset
- Returns:
- true if this asset should be the primary asset for the
category
, false otherwise
-
getSorted
Whether the persistent counterpart to thisCategoryAsset
has 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 byCategoryAsset
.- Specified by:
getSorted
in interfacecom.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
- Returns:
- Whether the persistent counterpart to this
CategoryAsset
has 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 ofTracking
information to expose the context state for this object.- Specified by:
getContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Returns:
- a subset of
Tracking
information to expose the context state for this object
-
setId
The context ID of the relationship.- Parameters:
id
- the context ID of the relationship
-
setCategoryId
The context ID of theCategory
associated with this asset.- Parameters:
categoryId
- the context ID of the category in the relationship
-
setPrimary
public void setPrimary(boolean primary) Determines whether this asset should be considered the primary asset for thecategory
.For any
category
, there can only be oneCategoryAsset
with this value set to true.- Specified by:
setPrimary
in interfacePrimaryAsset
- Parameters:
primary
- true if this asset should be the primary asset for thecategory
, false otherwise
-
setSorted
Whether the persistent counterpart to thisCategoryAsset
has 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 byCategoryAsset
.- Parameters:
sorted
- Whether the persistent counterpart to thisCategoryAsset
has 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 ofTracking
information to expose the context state for this object.- Specified by:
setContextState
in interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware
- Parameters:
contextState
- a subset ofTracking
information to expose the context state for this object
-
toString
- Overrides:
toString
in classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
equals
- Overrides:
equals
in classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
canEqual
- Overrides:
canEqual
in classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-
hashCode
public int hashCode()- Overrides:
hashCode
in classcom.broadleafcommerce.asset.consumer.domain.EntityAsset
-