Class CategoryProduct

java.lang.Object
com.broadleafcommerce.catalog.domain.CategoryProduct
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

public class CategoryProduct 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

A domain representing a relationship between Category and Product.

This relationship is different from PromotionalCategoryProduct, as it is not marketing-focused and has different properties and scale characteristics.

Author:
Phillip Verheyden (phillipuniverse), Samarth Dhruva (samarthd)
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    boolean
     
    The parent category in the relationship.
    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 child product in the relationship.
    Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting(), which determines order in admin list grids.
    Field indicating a sort order, if sorted.
    int
     
    boolean
    Determines whether the associated category should be considered the primary parent category of the associated product.
    void
    The parent category in the relationship.
    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 the associated category should be considered the primary parent category of the associated product.
    void
    The child product in the relationship.
    void
    Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting(), which determines order in admin list grids.
    void
    setSorting(String sorting)
    Field indicating a sort order, if sorted.
     

    Methods inherited from class java.lang.Object

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

    • CategoryProduct

      public CategoryProduct()
  • Method Details

    • getId

      public String getId()
      The context ID of the relationship.
      Returns:
      the context ID of the relationship
    • getProduct

      public Product getProduct()
      The child product in the relationship.
      Returns:
      the child product in the relationship
    • getCategory

      public CategoryRef getCategory()
      The parent category in the relationship.
      Returns:
      the parent category
    • isPrimary

      public boolean isPrimary()
      Determines whether the associated category should be considered the primary parent category of the associated product.
      Returns:
      true if the associated category is the primary parent of the product, false otherwise
    • 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
    • getSorted

      public Boolean getSorted()
      Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting(), which determines order in admin list grids.
      Specified by:
      getSorted in interface com.broadleafcommerce.data.tracking.core.sort.business.domain.Sorted
      Returns:
      Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting().
      See Also:
      • Sorted.getSorted()
      • Sortable
    • getSorting

      public String getSorting()
      Field indicating a sort order, if sorted. This is alphanumeric, allowing for lexicographical sorting.
    • setId

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

      public void setProduct(Product product)
      The child product in the relationship.
      Parameters:
      product - the child product in the relationship
    • setCategory

      public void setCategory(CategoryRef category)
      The parent category in the relationship.
      Parameters:
      category - the parent category
    • setPrimary

      public void setPrimary(boolean primary)
      Determines whether the associated category should be considered the primary parent category of the associated product.
      Parameters:
      primary - true if the associated category is the primary parent of the product, false otherwise
    • 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
    • setSorted

      public void setSorted(Boolean sorted)
      Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting(), which determines order in admin list grids.
      Parameters:
      sorted - Whether the persistent counterpart to this CategoryProduct has a non-default value for Sortable.getSorting().
      See Also:
      • Sorted.getSorted()
      • Sortable
    • setSorting

      public void setSorting(String sorting)
      Field indicating a sort order, if sorted. This is alphanumeric, allowing for lexicographical sorting.
    • 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