Class DataReferenceConverter
java.lang.Object
ma.glasnost.orika.CustomConverter<ReservationData,DataReference>
de.hybris.platform.coreairlinecommonsocc.mapping.converters.DataReferenceConverter
- All Implemented Interfaces:
ma.glasnost.orika.Converter<ReservationData,,DataReference> ma.glasnost.orika.MappedTypePair<ReservationData,DataReference>
public class DataReferenceConverter
extends ma.glasnost.orika.CustomConverter<ReservationData,DataReference>
Converter to convert the
ReservationData from DataReference.-
Field Summary
Fields inherited from class ma.glasnost.orika.CustomConverter
destinationType, mapperFacade, sourceType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAirportDetails(TransportOfferingData transportOfferingData, List<Airport> airportList) Add the airport detailsprotected voidaddPassengerDetails(List<TravellerData> travellerDataList, List<PassengerDetails> passengers) Populates the list of travellers.convert(ReservationData reservationData, ma.glasnost.orika.metadata.Type<? extends DataReference> type, ma.glasnost.orika.MappingContext mappingContext) Populates the data reference from the reservationData.protected static <T> Predicate<T>distinctByCode(Function<? super T, ?> codeExtractor) Filter used for filtering all the objects having duplicated code.protected voidpopulateAirportsAndLocations(TravelRouteData travelRouteData, List<Airport> airports, List<Location> locations) Populates the list of transport facilities and locations.protected voidpopulatePassengers(List<TravellerData> travellerDataList, List<Passenger> passengers) Populates the list of passengers.Methods inherited from class ma.glasnost.orika.CustomConverter
canConvert, equals, getAType, getBType, hashCode, setMapperFacade, toString
-
Constructor Details
-
DataReferenceConverter
public DataReferenceConverter()
-
-
Method Details
-
convert
public DataReference convert(ReservationData reservationData, ma.glasnost.orika.metadata.Type<? extends DataReference> type, ma.glasnost.orika.MappingContext mappingContext) Populates the data reference from the reservationData.- Parameters:
reservationData- reservationDatatype- the destination type of the conversionmappingContext- the mapping context- Returns:
- the DataReference
-
addPassengerDetails
protected void addPassengerDetails(List<TravellerData> travellerDataList, List<PassengerDetails> passengers) Populates the list of travellers. The list of traveller data is filtered by removing all the travellers that has been already added in the list of the travellers dto.- Parameters:
travellerDataList- the traveller data listpassengers- the passengers
-
addAirportDetails
protected void addAirportDetails(TransportOfferingData transportOfferingData, List<Airport> airportList) Add the airport details- Parameters:
transportOfferingData- the transport offering dataairportList- the airport list
-
populatePassengers
protected void populatePassengers(List<TravellerData> travellerDataList, List<Passenger> passengers) Populates the list of passengers. The list of traveller data is filtered by removing all the travellers that has been already added in the list of the travellers dto.- Parameters:
travellerDataList- the traveller data listpassengers- the passengers
-
populateAirportsAndLocations
protected void populateAirportsAndLocations(TravelRouteData travelRouteData, List<Airport> airports, List<Location> locations) Populates the list of transport facilities and locations.- Parameters:
travelRouteData- the travelRouteData dataairports- the airportslocations- the locations
-
distinctByCode
Filter used for filtering all the objects having duplicated code.- Type Parameters:
T- the type parameter- Parameters:
codeExtractor- the code extractor- Returns:
- the predicate
-