Class ChainMapper<INPUT,ATTRIBUTE extends ExcelAttribute>
- java.lang.Object
-
- com.hybris.backoffice.excel.template.mapper.ChainMapper<INPUT,ATTRIBUTE>
-
- Type Parameters:
INPUT- type of the input valueATTRIBUTE- type of the output. It has to extendExcelAttribute
- All Implemented Interfaces:
ExcelMapper<INPUT,ATTRIBUTE>,java.util.function.Function<INPUT,java.util.Collection<ATTRIBUTE>>
public class ChainMapper<INPUT,ATTRIBUTE extends ExcelAttribute> extends java.lang.Object implements ExcelMapper<INPUT,ATTRIBUTE>
Allows to chain twoExcelMappers. The result of the firstExcelMapperis then mapped to result ofExcelMapper. You can specify two collection ofExcelFilters - one for first mapping operation and another for second mapping operation. UsesetFilters1(Collection)to filter result ofmapper1andsetFilters2(Collection)to filter result ofmapper2.
-
-
Constructor Summary
Constructors Constructor Description ChainMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ATTRIBUTE>apply(INPUT input)protected booleanfilter1(AttributeDescriptorModel attributeDescriptor)protected booleanfilter2(ATTRIBUTE excelAttribute)voidsetFilters1(java.util.Collection<ExcelFilter<AttributeDescriptorModel>> filters1)voidsetFilters2(java.util.Collection<ExcelFilter<ATTRIBUTE>> filters2)voidsetMapper1(ExcelMapper<INPUT,AttributeDescriptorModel> mapper1)voidsetMapper2(ExcelMapper<java.util.Collection<AttributeDescriptorModel>,ATTRIBUTE> mapper2)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.backoffice.excel.template.mapper.ExcelMapper
filter
-
-
-
-
Method Detail
-
apply
public java.util.Collection<ATTRIBUTE> apply(INPUT input)
- Specified by:
applyin interfacejava.util.function.Function<INPUT,ATTRIBUTE extends ExcelAttribute>
-
filter1
protected boolean filter1(AttributeDescriptorModel attributeDescriptor)
-
filter2
protected boolean filter2(ATTRIBUTE excelAttribute)
-
setMapper1
public void setMapper1(ExcelMapper<INPUT,AttributeDescriptorModel> mapper1)
-
setMapper2
public void setMapper2(ExcelMapper<java.util.Collection<AttributeDescriptorModel>,ATTRIBUTE> mapper2)
-
setFilters1
public void setFilters1(java.util.Collection<ExcelFilter<AttributeDescriptorModel>> filters1)
-
setFilters2
public void setFilters2(java.util.Collection<ExcelFilter<ATTRIBUTE>> filters2)
-
-