Class ProductTag
java.lang.Object
com.broadleafcommerce.catalog.domain.tag.ProductTag
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
,com.broadleafcommerce.data.tracking.core.ContextStateAware
,com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
,Serializable
,Comparable<ProductTag>
public class ProductTag
extends Object
implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.ChangeContainerOverridable, com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted, Comparable<ProductTag>
This defines the relationship between a
Product
or Variant
and
AdvancedTag
. A product can have multiple ProductTags and determine relative priority via
ordering them in the admin. This relationship will also be used during indexing to hydrate the
tags for a product to enable faceting, searching, and boosting.- Author:
- Nathan Moore (nathandmoore)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
int
compareTo
(@NotNull ProductTag o) boolean
End when this tag is not longer active.Start of when this tag should be active for the product.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState
A subset ofTracking
information to expose the context state for this object.getId()
A unique system identifier.com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer
TheVariant
to associate to thetag
to.Whether the persistent counterpart to this object has a non-default value forSortable.getSorting()
, which determines order in admin list-grids and the relative precedence of thetag
compared to others related to theproduct
on the storefront.Field indicating a sort order, if sorted.getTag()
TheAdvancedTag
to associate with theproduct
.getTagId()
TheVariant
to associate to thetag
to.int
hashCode()
void
setActiveEndDate
(Instant activeEndDate) End when this tag is not longer active.void
setActiveStartDate
(Instant activeStartDate) Start of when this tag should be active for the product.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
A unique system identifier.void
setOverrideChangeContainer
(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) void
setProduct
(Product product) TheVariant
to associate to thetag
to.void
Whether the persistent counterpart to this object has a non-default value forSortable.getSorting()
, which determines order in admin list-grids and the relative precedence of thetag
compared to others related to theproduct
on the storefront.void
setSorting
(String sorting) Field indicating a sort order, if sorted.void
setTag
(AdvancedTag tag) TheAdvancedTag
to associate with theproduct
.void
setVariant
(Variant variant) TheVariant
to associate to thetag
to.toString()
-
Constructor Details
-
ProductTag
public ProductTag()
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ProductTag>
-
getProductId
-
getTagId
-
getVariantId
-
getId
A unique system identifier.- Returns:
- A unique system identifier.
-
getTag
TheAdvancedTag
to associate with theproduct
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the tag don't have to be synced and there is no unnecessary duplication of data.
- Returns:
- The
AdvancedTag
to associate with theproduct
.
-
getProduct
TheVariant
to associate to thetag
to. May be null, but one of either theVariant
orProduct
must be set. See#targetType
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the product don't have to be synced and there is no unnecessary duplication of data.
- Returns:
- The
Product
to associate to thetag
to.
-
getVariant
TheVariant
to associate to thetag
to. May be null, but one of either theVariant
orProduct
must be set. See#targetType
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the product don't have to be synced and there is no unnecessary duplication of data.
- Returns:
- The
Product
to associate to thetag
to.
-
getSorted
Whether the persistent counterpart to this object has a non-default value forSortable.getSorting()
, which determines order in admin list-grids and the relative precedence of thetag
compared to others related to theproduct
on the storefront.- Specified by:
getSorted
in interfacecom.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
- Returns:
- Whether the persistent counterpart to this object has a non-default value for
Sortable.getSorting()
. - See Also:
-
Sorted.getSorted()
Sortable
for specific sort order value
-
getSorting
Field indicating a sort order, if sorted. This is alphanumeric, allowing for lexicographical sorting.- Returns:
- Field indicating a sort order, if sorted.
- See Also:
-
which is a flag signifying whether this is sorted
-
getActiveStartDate
Start of when this tag should be active for the product. This implicitly inherits from theAdvancedTag
: If the tag isn't active, neither will this ProductTag, but the reverse is not true.- Returns:
- the date when this tag should start being active
-
getActiveEndDate
End when this tag is not longer active. Unset indicates that it is always active. This implicitly inherits from theAdvancedTag
: If the tag isn't active, neither will this ProductTag, but the reverse is not true.- Returns:
- the date when this tag should no longer be active
-
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
-
getOverrideChangeContainer
public com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer getOverrideChangeContainer()- Specified by:
getOverrideChangeContainer
in interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
-
setId
A unique system identifier.- Parameters:
id
- A unique system identifier.
-
setTag
TheAdvancedTag
to associate with theproduct
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the tag don't have to be synced and there is no unnecessary duplication of data.
- Parameters:
tag
- TheAdvancedTag
to associate with theproduct
.
-
setProduct
TheVariant
to associate to thetag
to. May be null, but one of either theVariant
orProduct
must be set. See#targetType
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the product don't have to be synced and there is no unnecessary duplication of data.
- Parameters:
product
- TheProduct
to associate to thetag
to.
-
setVariant
TheVariant
to associate to thetag
to. May be null, but one of either theVariant
orProduct
must be set. See#targetType
.IMPORTANT: This value is not automatically hydrated when the persistent domain is converted into this projection. That can be done programmatically if needed. The persistent domain stores a leaner representation by default so that updates to the product don't have to be synced and there is no unnecessary duplication of data.
- Parameters:
product
- TheProduct
to associate to thetag
to.
-
setSorted
Whether the persistent counterpart to this object has a non-default value forSortable.getSorting()
, which determines order in admin list-grids and the relative precedence of thetag
compared to others related to theproduct
on the storefront.- Parameters:
sorted
- Whether the persistent counterpart to this object has a non-default value forSortable.getSorting()
.- See Also:
-
Sorted.getSorted()
Sortable
for specific sort order value
-
setSorting
Field indicating a sort order, if sorted. This is alphanumeric, allowing for lexicographical sorting.- Parameters:
sorting
- Field indicating a sort order, if sorted.- See Also:
-
which is a flag signifying whether this is sorted
-
setActiveStartDate
Start of when this tag should be active for the product. This implicitly inherits from theAdvancedTag
: If the tag isn't active, neither will this ProductTag, but the reverse is not true.- Parameters:
activeStartDate
- the date when this tag should start being active
-
setActiveEndDate
End when this tag is not longer active. Unset indicates that it is always active. This implicitly inherits from theAdvancedTag
: If the tag isn't active, neither will this ProductTag, but the reverse is not true.- Parameters:
activeEndDate
- the date when this tag should no longer be active
-
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
-
setOverrideChangeContainer
public void setOverrideChangeContainer(com.broadleafcommerce.data.tracking.core.filtering.domain.ChangeContainer overrideChangeContainer) - Specified by:
setOverrideChangeContainer
in interfacecom.broadleafcommerce.data.tracking.core.ChangeContainerOverridable
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-