Class AbstractRawItemBuilder<T extends AbstractItemModel>
- java.lang.Object
-
- de.hybris.platform.sap.orderexchange.outbound.impl.AbstractRawItemBuilder<T>
-
- Type Parameters:
T
- The item model for which the raw item shall be assembled
- All Implemented Interfaces:
RawItemBuilder<T>
- Direct Known Subclasses:
DefaultOrderCancelRequestBuilder
,DefaultRawHybrisOrderBuilder
,DefaultRawQuoteBuilder
public abstract class AbstractRawItemBuilder<T extends AbstractItemModel> extends java.lang.Object implements RawItemBuilder<T>
Default raw item builder delegating the creation of the individual lines of the raw item to the registered instances ofRawItemContributor
. The results are merged into one list. Fields not provided by all contributors are defaulted to ""
-
-
Constructor Summary
Constructors Constructor Description AbstractRawItemBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addContributor(RawItemContributor<T> c)
java.util.Set<java.lang.String>
getColumns()
java.util.List<RawItemContributor<T>>
getContributors()
protected abstract org.apache.log4j.Logger
getLogger()
protected boolean
isDebug()
java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
rowsAsNameValuePairs(T model)
void
setContributors(java.util.List<RawItemContributor<T>> contributors)
Inject the list of contributors to the CSV string to be built.
-
-
-
Method Detail
-
getContributors
public java.util.List<RawItemContributor<T>> getContributors()
- Specified by:
getContributors
in interfaceRawItemBuilder<T extends AbstractItemModel>
- Returns:
- Contributors to the CSV creation
-
getColumns
public java.util.Set<java.lang.String> getColumns()
- Specified by:
getColumns
in interfaceRawItemBuilder<T extends AbstractItemModel>
- Returns:
- the union of all column names used the the registered contributors
-
setContributors
public void setContributors(java.util.List<RawItemContributor<T>> contributors)
Description copied from interface:RawItemBuilder
Inject the list of contributors to the CSV string to be built. To be called before method @seeRawItemBuilder.rowsAsNameValuePairs(AbstractItemModel)
is called- Specified by:
setContributors
in interfaceRawItemBuilder<T extends AbstractItemModel>
-
rowsAsNameValuePairs
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> rowsAsNameValuePairs(T model)
- Specified by:
rowsAsNameValuePairs
in interfaceRawItemBuilder<T extends AbstractItemModel>
- Parameters:
model
- item model for which the raw item shall be assembled- Returns:
- Columns of the CSV according to the registered contributors
-
addContributor
public void addContributor(RawItemContributor<T> c)
- Specified by:
addContributor
in interfaceRawItemBuilder<T extends AbstractItemModel>
- Parameters:
c
- contributor to add
-
isDebug
protected boolean isDebug()
-
getLogger
protected abstract org.apache.log4j.Logger getLogger()
-
-