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.
  • 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 - reservationData
      type - the destination type of the conversion
      mappingContext - 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 list
      passengers - the passengers
    • addAirportDetails

      protected void addAirportDetails(TransportOfferingData transportOfferingData, List<Airport> airportList)
      Add the airport details
      Parameters:
      transportOfferingData - the transport offering data
      airportList - 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 list
      passengers - 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 data
      airports - the airports
      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