amcofferDetailsData.getSolutions().
forEach(sol -> {
List<AMCSolutionDetailProductWsDTO> mappedOfferEntries =
sol.getOfferEntries().getOfferLinesList()
.stream()
.filter(offerEntry -> offerEntry instanceof
AMCSolutionDetailProductData)
.map(offerEntry ->
getDataMapper().map((AMCSolutionDetailProductData) offerEntry,
AMCSolutionDetailProductWsDTO.class, fields))
.collect(Collectors.toList());
sol.getOfferEntries().setOfferLinesList(mappedOfferEntries);
});
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="beans.xsd">
<bean
class="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferDetailsWsDTO">
<property name="solutions"
type="java.util.List<com.arcelormittal.amc.amcoffersocc.dto.offer.AMCSolutionWsD
TO>">
<description>Solutions</description>
</property>
</bean>
<bean class="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCSolutionWsDTO">
<property name="offerEntries"
type="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferSpecificationsWsDTO">
<description>Offer entries</description>
</property>
</bean>
<bean
class="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferSpecificationsWsDTO">
<property name="offerLinesList"
type="java.util.List<com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferEntryS
pecificationWsDTO>">
<description>Offer lines list</description>
</property>
</bean>
<bean
class="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferEntrySpecificationWsDTO
">
<property name="entryType" type="String">
<description>Entry type</description>
</property>
<property name="solutionId" type="String">
<description>Solution id</description>
</property>
</bean>
<bean
class="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCSolutionDetailProductWsDTO"
extends="com.arcelormittal.amc.amcoffersocc.dto.offer.AMCOfferEntrySpecificationWsD
TO">
<property name="entryNumber" type="Integer">
<description>Entry number</description>
</property>
</bean>
</beans>
<!-- Field mapping configuration -->
<bean id="dataMapper"
class="de.hybris.platform.webservicescommons.mapping.impl.DefaultDataMapper">
<property name="fieldSetBuilder" ref="fieldSetBuilder" />
</bean>