Class TransportReservationDataReferenceConverter
java.lang.Object
ma.glasnost.orika.CustomConverter<ReservationData,TransportReservationDataReference>
de.hybris.platform.coretravelcommonsocc.mapping.converters.TransportReservationDataReferenceConverter
- All Implemented Interfaces:
ma.glasnost.orika.Converter<ReservationData,,TransportReservationDataReference> ma.glasnost.orika.MappedTypePair<ReservationData,TransportReservationDataReference>
public class TransportReservationDataReferenceConverter
extends ma.glasnost.orika.CustomConverter<ReservationData,TransportReservationDataReference>
Converter to convert the
ReservationData from TransportReservationDataReference.-
Field Summary
Fields inherited from class ma.glasnost.orika.CustomConverter
destinationType, mapperFacade, sourceType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvert(ReservationData reservationData, ma.glasnost.orika.metadata.Type<? extends TransportReservationDataReference> type, ma.glasnost.orika.MappingContext mappingContext) Populates the transport 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 voidpopulateTransportFacilitiesAndLocations(TravelRouteData travelRouteData, List<TransportFacility> transportFacilities, List<Location> locations) Populates the list of transport facilities and locations.protected voidpopulateTransportOfferings(List<OriginDestinationOptionData> originDestinationOptions, List<TransportOffering> transportOfferings) Populates the list of transport offerings.protected voidpopulateTravellers(List<TravellerData> travellerDataList, List<Traveller> travellers) Populates the list of travellers.protected voidpopulateTravelRoutesAndSectors(ItineraryData itineraryData, List<TravelRoute> travelRoutes, List<TravelSector> travelSectors, List<TransportFacility> transportFacilities, List<Location> locations) Populates the travel route and travel sector list, together with transport facilities and locations.Methods inherited from class ma.glasnost.orika.CustomConverter
canConvert, equals, getAType, getBType, hashCode, setMapperFacade, toString
-
Constructor Details
-
TransportReservationDataReferenceConverter
public TransportReservationDataReferenceConverter()
-
-
Method Details
-
convert
public TransportReservationDataReference convert(ReservationData reservationData, ma.glasnost.orika.metadata.Type<? extends TransportReservationDataReference> type, ma.glasnost.orika.MappingContext mappingContext) Populates the transport data reference from the reservationData.- Parameters:
reservationData- the transport reservation data, containing details for transport order entriestype- the destination type of the conversionmappingContext- the mapping context- Returns:
- the TransportReservation
-
populateTravellers
protected void populateTravellers(List<TravellerData> travellerDataList, List<Traveller> travellers) 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 listtravellers- the travellers
-
populateTransportOfferings
protected void populateTransportOfferings(List<OriginDestinationOptionData> originDestinationOptions, List<TransportOffering> transportOfferings) Populates the list of transport offerings.- Parameters:
originDestinationOptions- the origin destination optionstransportOfferings- the transport offerings
-
populateTransportFacilitiesAndLocations
protected void populateTransportFacilitiesAndLocations(TravelRouteData travelRouteData, List<TransportFacility> transportFacilities, List<Location> locations) Populates the list of transport facilities and locations.- Parameters:
travelRouteData- the travelRouteData datatransportFacilities- the transport facilitieslocations- the locations
-
populateTravelRoutesAndSectors
protected void populateTravelRoutesAndSectors(ItineraryData itineraryData, List<TravelRoute> travelRoutes, List<TravelSector> travelSectors, List<TransportFacility> transportFacilities, List<Location> locations) Populates the travel route and travel sector list, together with transport facilities and locations.- Parameters:
itineraryData- the itinerary datatravelRoutes- the travel routestravelSectors- the travel sectorstransportFacilities- the transport facilitieslocations- 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
-