com.elasticpath.domain.catalogview.impl
Class BrandFilterImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.catalogview.impl.AbstractFilterImpl
              extended by com.elasticpath.domain.catalogview.impl.BrandFilterImpl
All Implemented Interfaces:
BrandFilter, Filter, EpDomain, Transient, java.io.Serializable, java.lang.Comparable

public class BrandFilterImpl
extends AbstractFilterImpl
implements BrandFilter

This class is a filter implementation on the products' brands.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.catalogview.Filter
SEPARATOR, SEPARATOR_IN_REGEX
 
Constructor Summary
BrandFilterImpl()
          Default Constructer.
 
Method Summary
 int compareTo(java.lang.Object object)
          Compares this object with the specified object for ordering.
 boolean equals(java.lang.Object object)
          Returns true if this filter equals to the given object.
 java.lang.String getDisplayName(java.util.Locale locale)
          Returns the display name of the filter with the given locale.
 java.lang.String getSeoId()
          Returns the SEO identifier of the filter with the given locale.
 java.lang.String getSeoName(java.util.Locale locale)
          Returns the SEO url of the filter with the given locale.
 int hashCode()
          Returns the hash code.
 void initialize(java.lang.String filterId)
          Sets the id of the filter.
 boolean match(java.lang.Object obj)
          Check whether the given object has the same brand with this filter.
 void setBrandService(BrandService brandService)
          Sets the brand servcie.
 void setUtility(Utility utility)
          Sets the utility.
 
Methods inherited from class com.elasticpath.domain.catalogview.impl.AbstractFilterImpl
filter, getId, isLocalized, setId, setLocalized
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.catalogview.Filter
filter, getId, isLocalized, setId, setLocalized
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

BrandFilterImpl

public BrandFilterImpl()
Default Constructer.

Method Detail

compareTo

public int compareTo(java.lang.Object object)
              throws EpDomainException
Compares this object with the specified object for ordering.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the given object
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
EpDomainException - in case the given object is not a BrandFilter

equals

public boolean equals(java.lang.Object object)
Returns true if this filter equals to the given object.

Overrides:
equals in class AbstractFilterImpl
Parameters:
object - the object to compare
Returns:
true if this filter equals to the given object.

getDisplayName

public java.lang.String getDisplayName(java.util.Locale locale)
Returns the display name of the filter with the given locale.

Specified by:
getDisplayName in interface Filter
Parameters:
locale - the locale
Returns:
the display name of the filter with the given locale.

getSeoId

public java.lang.String getSeoId()
Returns the SEO identifier of the filter with the given locale.

Specified by:
getSeoId in interface Filter
Overrides:
getSeoId in class AbstractFilterImpl
Returns:
the SEO identifier of the filter with the given locale.

getSeoName

public java.lang.String getSeoName(java.util.Locale locale)
Returns the SEO url of the filter with the given locale. Currently the display name will be used as the seo url.

Specified by:
getSeoName in interface Filter
Parameters:
locale - the locale
Returns:
the SEO url of the filter with the given locale.

hashCode

public int hashCode()
Returns the hash code.

Overrides:
hashCode in class AbstractFilterImpl
Returns:
the hash code

initialize

public void initialize(java.lang.String filterId)
Sets the id of the filter.

Specified by:
initialize in interface Filter
Parameters:
filterId - the id to set

match

public boolean match(java.lang.Object obj)
Check whether the given object has the same brand with this filter. Generally, the given object should be a product.

Specified by:
match in interface Filter
Parameters:
obj - the given object.
Returns:
true: the given object matchs with the filter.

setBrandService

public void setBrandService(BrandService brandService)
Sets the brand servcie.

Parameters:
brandService - the brand servcie

setUtility

public void setUtility(Utility utility)
Sets the utility.

Parameters:
utility - the utility.