Class SearchFacetImpl

java.lang.Object
org.broadleafcommerce.core.search.domain.SearchFacetImpl
All Implemented Interfaces:
Serializable, org.broadleafcommerce.common.admin.domain.AdminMainEntity, org.broadleafcommerce.common.copy.MultiTenantCloneable<SearchFacet>, SearchFacet, SearchFacetAdminPresentation

@Entity public class SearchFacetImpl extends Object implements SearchFacet, Serializable, org.broadleafcommerce.common.admin.domain.AdminMainEntity, SearchFacetAdminPresentation
See Also:
  • Field Details

    • id

      protected Long id
    • name

      protected String name
    • label

      protected String label
    • fieldType

      protected IndexFieldType fieldType
    • showOnSearch

      protected Boolean showOnSearch
    • useFacetRanges

      protected Boolean useFacetRanges
    • searchDisplayPriority

      protected Integer searchDisplayPriority
    • canMultiselect

      protected Boolean canMultiselect
    • searchFacetRanges

      protected List<SearchFacetRange> searchFacetRanges
    • requiredFacets

      protected List<RequiredFacet> requiredFacets
    • requiresAllDependentFacets

      protected Boolean requiresAllDependentFacets
  • Constructor Details

    • SearchFacetImpl

      public SearchFacetImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: SearchFacet
      Returns the internal id
      Specified by:
      getId in interface SearchFacet
      Returns:
      the internal id
    • setId

      public void setId(Long id)
      Description copied from interface: SearchFacet
      Sets the internal id
      Specified by:
      setId in interface SearchFacet
    • getFieldType

      public IndexFieldType getFieldType()
      Description copied from interface: SearchFacet
      The main relationship to the rest of the search index entities
      Specified by:
      getFieldType in interface SearchFacet
    • setFieldType

      public void setFieldType(IndexFieldType fieldType)
      Specified by:
      setFieldType in interface SearchFacet
    • getField

      public Field getField()
      Description copied from interface: SearchFacet

      Returns the field associated with this facet.

      This is a convenience method for

      getFieldType().getIndexField().getField()
      Specified by:
      getField in interface SearchFacet
      Returns:
      the fieldName
    • getFacetFieldType

      public String getFacetFieldType()
      Description copied from interface: SearchFacet

      This String represents the FieldType for the given SearchFacet. This is the FieldType that will be used when this Field is indexed in Solr

      This is a convience method for

      getFieldType().getFieldType().getType()
      Specified by:
      getFacetFieldType in interface SearchFacet
      Returns:
      the String representing the FieldType of this SearchFacet
    • getName

      public String getName()
      Description copied from interface: SearchFacet
      Gets the name of this SearchFacet. This is for admin naming purposes.
      Specified by:
      getName in interface SearchFacet
      Returns:
      the name
    • setName

      public void setName(String name)
      Description copied from interface: SearchFacet
      Sets the name
      Specified by:
      setName in interface SearchFacet
      See Also:
    • getLabel

      public String getLabel()
      Description copied from interface: SearchFacet
      Gets the label of this SearchFacet. This is the label that will be used for the user-friendly display name of this facet
      Specified by:
      getLabel in interface SearchFacet
      Returns:
      the label
    • setLabel

      public void setLabel(String label)
      Description copied from interface: SearchFacet
      Sets the label
      Specified by:
      setLabel in interface SearchFacet
      See Also:
    • getShowOnSearch

      public Boolean getShowOnSearch()
      Description copied from interface: SearchFacet
      Gets a boolean that specifies whether or not this SearchFacet should be displayed on search result pages in addition to category pages
      Specified by:
      getShowOnSearch in interface SearchFacet
      Returns:
      whether or not to display on search result pages
    • setShowOnSearch

      public void setShowOnSearch(Boolean showOnSearch)
      Description copied from interface: SearchFacet
      Sets showOnSearch
      Specified by:
      setShowOnSearch in interface SearchFacet
      See Also:
    • getSearchDisplayPriority

      public Integer getSearchDisplayPriority()
      Description copied from interface: SearchFacet
      Gets the display priority of this SearchFacet on search result pages
      Specified by:
      getSearchDisplayPriority in interface SearchFacet
      Returns:
      the priority
    • setSearchDisplayPriority

      public void setSearchDisplayPriority(Integer searchDisplayPriority)
      Description copied from interface: SearchFacet
      Sets the display priority on search result pages
      Specified by:
      setSearchDisplayPriority in interface SearchFacet
    • getCanMultiselect

      public Boolean getCanMultiselect()
      Description copied from interface: SearchFacet
      Gets whether or not you can multiselect values for this Facet
      Specified by:
      getCanMultiselect in interface SearchFacet
      Returns:
      the multiselect flag
    • setCanMultiselect

      public void setCanMultiselect(Boolean canMultiselect)
      Description copied from interface: SearchFacet
      Sets whether or not you can multiselect values for this Facet.
      Specified by:
      setCanMultiselect in interface SearchFacet
    • getUseFacetRanges

      public Boolean getUseFacetRanges()
      Description copied from interface: SearchFacet
      Gets whether or not this facet uses facet ranges
      Specified by:
      getUseFacetRanges in interface SearchFacet
      Returns:
      the useFacetRanges flag
    • setUseFacetRanges

      public void setUseFacetRanges(Boolean useFacetRanges)
      Description copied from interface: SearchFacet
      Sets useFacetRanges
      Specified by:
      setUseFacetRanges in interface SearchFacet
      See Also:
    • getRequiredFacets

      public List<RequiredFacet> getRequiredFacets()
      Specified by:
      getRequiredFacets in interface SearchFacet
      Returns:
      a list of SearchFacets that must have an active value set for this SearchFacet to be applicable.
      See Also:
    • setRequiredFacets

      public void setRequiredFacets(List<RequiredFacet> requiredFacets)
      Description copied from interface: SearchFacet
      Sets the list of facets which this facet depends on.
      Specified by:
      setRequiredFacets in interface SearchFacet
    • getRequiresAllDependentFacets

      public Boolean getRequiresAllDependentFacets()
      Description copied from interface: SearchFacet
      This boolean controls whether or not this particular facet requires one of the dependent facets to be active, or if it requires all of the dependent facets to be active.
      Specified by:
      getRequiresAllDependentFacets in interface SearchFacet
      Returns:
      whether the dependent facet list should be AND'ed together
      See Also:
    • setRequiresAllDependentFacets

      public void setRequiresAllDependentFacets(Boolean requiresAllDependentFacets)
      Description copied from interface: SearchFacet
      Sets whether or not all dependent facets must be active, or if only one is necessary
      Specified by:
      setRequiresAllDependentFacets in interface SearchFacet
    • getSearchFacetRanges

      public List<SearchFacetRange> getSearchFacetRanges()
      Description copied from interface: SearchFacet
      Gets the applicable ranges for this search facet, if any are specified. For example, the SearchFacet that interacts with "Manufacturers" might not have any ranges defined (as it would depend on the manufacturers that are in the result list), but a facet on "Price" might have predefined ranges (such as 0-5, 5-10, 10-20).
      Specified by:
      getSearchFacetRanges in interface SearchFacet
      Returns:
      the associated search facet ranges, if any
    • setSearchFacetRanges

      public void setSearchFacetRanges(List<SearchFacetRange> searchFacetRanges)
      Description copied from interface: SearchFacet
      Sets the SearchFacetRanges Note: This method will set ALL search facet ranges
      Specified by:
      setSearchFacetRanges in interface SearchFacet
      See Also:
    • createOrRetrieveCopyInstance

      public <G extends SearchFacet> org.broadleafcommerce.common.copy.CreateResponse<G> createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext context) throws CloneNotSupportedException
      Specified by:
      createOrRetrieveCopyInstance in interface org.broadleafcommerce.common.copy.MultiTenantCloneable<SearchFacet>
      Throws:
      CloneNotSupportedException
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getMainEntityName

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface org.broadleafcommerce.common.admin.domain.AdminMainEntity