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.
  • 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 entries
      type - the destination type of the conversion
      mappingContext - 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 list
      travellers - the travellers
    • populateTransportOfferings

      protected void populateTransportOfferings(List<OriginDestinationOptionData> originDestinationOptions, List<TransportOffering> transportOfferings)
      Populates the list of transport offerings.
      Parameters:
      originDestinationOptions - the origin destination options
      transportOfferings - 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 data
      transportFacilities - the transport facilities
      locations - 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 data
      travelRoutes - the travel routes
      travelSectors - the travel sectors
      transportFacilities - the transport facilities
      locations - the locations
    • distinctByCode

      protected static <T> Predicate<T> distinctByCode(Function<? super T,?> codeExtractor)
      Filter used for filtering all the objects having duplicated code.
      Type Parameters:
      T - the type parameter
      Parameters:
      codeExtractor - the code extractor
      Returns:
      the predicate