com.elasticpath.domain.catalogview.search.impl
Class SearchRequestImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
              extended by com.elasticpath.domain.catalogview.search.impl.SearchRequestImpl
All Implemented Interfaces:
CatalogViewRequest, SearchRequest, EpDomain, Transient, java.io.Serializable

public class SearchRequestImpl
extends AbstractCatalogViewRequestImpl
implements SearchRequest

Represents a default implementation of SearchRequest.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
AbstractCatalogViewRequestImpl.FilterQueryStringImpl
 
Nested classes/interfaces inherited from interface com.elasticpath.domain.catalogview.CatalogViewRequest
CatalogViewRequest.FilterQueryString
 
Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
SearchRequestImpl()
           
 
Method Summary
 CatalogViewRequest addFilter(Filter filter)
          Creates and returns a more specific search request by adding the given filter.
 int compare(CatalogViewRequest searchRequest)
          Compares this search requet with the given search request.
 java.lang.String getEncodedKeyWords()
          Returns the url-encoded key words.
 java.lang.String getKeyWords()
          Returns the keywords specified in the search request.
 java.lang.String getQueryString()
          Returns the query string.
 boolean isFuzzySearchDisabled()
          Returns whether or not a fuzzy search should be performed for this query.
 void setFuzzySearchDisabled(boolean fuzzySearchDisabled)
          Sets whether or not a fuzzy search should be performed for this query.
 void setKeyWords(java.lang.String keyWords)
          Sets the keywords.
 
Methods inherited from class com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
filterProducts, getCategoryUid, getCurrency, getFilterIds, getFilterQueryStrings, getFilters, getLocale, getMaxReturnNumber, getSorter, getSorterFactory, setCategoryUid, setCurrency, setFilterFactory, setFiltersIdStr, setLocale, setMaxReturnNumber, setSorterFactory, setSorterIdStr
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.catalogview.CatalogViewRequest
filterProducts, getCategoryUid, getCurrency, getFilterIds, getFilterQueryStrings, getFilters, getLocale, getMaxReturnNumber, getSorter, getSorterFactory, setCategoryUid, setCurrency, setFiltersIdStr, setLocale, setMaxReturnNumber, setSorterIdStr
 
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

SearchRequestImpl

public SearchRequestImpl()
Method Detail

addFilter

public CatalogViewRequest addFilter(Filter filter)
Creates and returns a more specific search request by adding the given filter.

Specified by:
addFilter in interface CatalogViewRequest
Parameters:
filter - the search filter to add
Returns:
a more specific search request

compare

public int compare(CatalogViewRequest searchRequest)
            throws CatalogViewRequestUnmatchException
Compares this search requet with the given search request.

Specified by:
compare in interface CatalogViewRequest
Parameters:
searchRequest - the search request to compare
Returns:
0 if this search request and the given search request has same key words and filters.

1 if this search request and the given search request has same key words, but has more filters.

-1 if this search request and the given search request has same key words, but has unmatching filters.

Throws:
CatalogViewRequestUnmatchException - when this search requet and the given search request have different key words

getEncodedKeyWords

public java.lang.String getEncodedKeyWords()
Returns the url-encoded key words.

Specified by:
getEncodedKeyWords in interface SearchRequest
Returns:
the url-encoded key words.

getKeyWords

public java.lang.String getKeyWords()
Returns the keywords specified in the search request.

Specified by:
getKeyWords in interface SearchRequest
Returns:
the keywords

getQueryString

public java.lang.String getQueryString()
Returns the query string.

Specified by:
getQueryString in interface CatalogViewRequest
Returns:
the query string.

isFuzzySearchDisabled

public boolean isFuzzySearchDisabled()
Returns whether or not a fuzzy search should be performed for this query.

Specified by:
isFuzzySearchDisabled in interface SearchRequest
Returns:
true if fuzzy search is disabled, false otherwise

setFuzzySearchDisabled

public void setFuzzySearchDisabled(boolean fuzzySearchDisabled)
Sets whether or not a fuzzy search should be performed for this query.

Specified by:
setFuzzySearchDisabled in interface SearchRequest
Parameters:
fuzzySearchDisabled - whether or not fuzzy search should be disabled

setKeyWords

public void setKeyWords(java.lang.String keyWords)
                 throws EpCatalogViewRequestBindException
Sets the keywords.

Specified by:
setKeyWords in interface SearchRequest
Parameters:
keyWords - the keywords to set
Throws:
EpCatalogViewRequestBindException - in case the given keywords is invalid