Class AbstractSolrConverter<T>
- java.lang.Object
-
- de.hybris.platform.solrfacetsearch.search.AbstractSolrConverter<T>
-
- All Implemented Interfaces:
Converter<SolrResult,T>,org.springframework.core.convert.converter.Converter<SolrResult,T>
- Direct Known Subclasses:
DefaultSolrProductConverter
public abstract class AbstractSolrConverter<T> extends java.lang.Object implements Converter<SolrResult,T>
Defines common implementation of conversion from SolrResult to Data (DTO) object.- See Also:
SolrResult
-
-
Constructor Summary
Constructors Constructor Description AbstractSolrConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tconvert(SolrResult source)Converts the source object, creating a new instance of the destination typeprotected abstract TcreateDataObject()Returns empty template instance for the conversion targetprotected FieldNameTranslatorgetFieldNameTranslator()protected <TYPE> TYPEgetValue(SolrResult solrResult, IndexedProperty property)Returns value of the indexed property from the SOLR search result byIndexedPropertyinstance.protected <TYPE> TYPEgetValue(SolrResult solrResult, java.lang.String propertyName)Returns value of the indexed property from the SOLR search result by (not translated) name .voidsetFieldNameTranslator(FieldNameTranslator fieldNameTranslator)protected java.lang.StringtranslateFieldName(SearchQuery searchQuery, IndexedProperty property)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convert, convertAll, convertAllIgnoreExceptions, getLogger
-
-
-
-
Method Detail
-
convert
public T convert(SolrResult source)
Description copied from interface:ConverterConverts the source object, creating a new instance of the destination type- Specified by:
convertin interfaceConverter<SolrResult,T>- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<SolrResult,T>- Parameters:
source- the source object- Returns:
- the converted object
-
createDataObject
protected abstract T createDataObject()
Returns empty template instance for the conversion target
-
getValue
protected <TYPE> TYPE getValue(SolrResult solrResult, java.lang.String propertyName)
Returns value of the indexed property from the SOLR search result by (not translated) name .- Parameters:
solrResult-SolrResultpropertyName- - non-translated property name
-
getValue
protected <TYPE> TYPE getValue(SolrResult solrResult, IndexedProperty property)
Returns value of the indexed property from the SOLR search result byIndexedPropertyinstance.- Parameters:
solrResult-SolrResultproperty- -IndexedProperty
-
translateFieldName
protected java.lang.String translateFieldName(SearchQuery searchQuery, IndexedProperty property)
-
getFieldNameTranslator
protected FieldNameTranslator getFieldNameTranslator()
-
setFieldNameTranslator
public void setFieldNameTranslator(FieldNameTranslator fieldNameTranslator)
-
-