Class AncillarySearchResponseConverter

java.lang.Object
ma.glasnost.orika.CustomConverter<OfferResponseData,AncillaryResponse>
de.hybris.platform.coretransportocc.mapping.converters.AncillarySearchResponseConverter
All Implemented Interfaces:
ma.glasnost.orika.Converter<OfferResponseData,AncillaryResponse>, ma.glasnost.orika.MappedTypePair<OfferResponseData,AncillaryResponse>

public class AncillarySearchResponseConverter extends ma.glasnost.orika.CustomConverter<OfferResponseData,AncillaryResponse>
This is to populate Search Response for the Ancillaries
  • Constructor Details

    • AncillarySearchResponseConverter

      public AncillarySearchResponseConverter()
  • Method Details

    • convert

      public AncillaryResponse convert(OfferResponseData offerResponseData, ma.glasnost.orika.metadata.Type<? extends AncillaryResponse> type, ma.glasnost.orika.MappingContext mappingContext)
      Converts the offer response data to AncillarySearchWSResponseDTO
      Parameters:
      offerResponseData - the offerResponseData
      type - the type
      mappingContext - the mappingContext
      Returns:
      AncillarySearchWSResponseDTO
    • getAncillaries

      protected List<Ancillary> getAncillaries(OfferResponseData offerResponseData)
      get Ancillaries
      Parameters:
      offerResponseData - the offer response data
      Returns:
      AncillariesWSResponseDTO list
    • getAncillariesValidForRoute

      protected void getAncillariesValidForRoute(List<Ancillary> ancillaryList, OfferGroupData offerGroupData)
      get Ancillaries Valid For Route
      Parameters:
      ancillaryList - the ancillary list
      offerGroupData - the offer group data
    • populateAncillaries

      protected void populateAncillaries(List<Ancillary> ancillaryList, OfferGroupData offerGroupData, OriginDestinationOfferInfoData originDestinationOfferInfoData, OfferPricingInfoData offerPricingInfoData)
      populate Ancillaries
      Parameters:
      ancillaryList - the ancillary list
      offerGroupData - the offer group data
      originDestinationOfferInfoData - the origin destination offer info data
      offerPricingInfoData - the offer pricing info data
    • getPassengerRefUids

      protected List<String> getPassengerRefUids(OfferPricingInfoData offerPricingInfoData)
      get Passenger Ref Uids
      Parameters:
      offerPricingInfoData - the offer pricing info data
      Returns:
      list of traveller Id
    • populatePrices

      protected List<AncillaryPricesResponse> populatePrices(OriginDestinationOfferInfoData originDestinationOfferInfoData, PassengerFareData passengerFareData)
      get prices for ancillaries
      Parameters:
      originDestinationOfferInfoData - the origin destination offer info data
      passengerFareData - the passenger fare data
      Returns:
      AncillaryPricesResponse list
    • getTransportOfferingCodes

      protected List<String> getTransportOfferingCodes(OriginDestinationOfferInfoData originDestinationOfferInfoData)
      get Transport Offering Codes
      Parameters:
      originDestinationOfferInfoData - the origin destination offer info data
      Returns:
      list of transport offering codes
    • populateDiscounts

      protected Discount populateDiscounts(List<DiscountData> discounts)
      populate Discounts
      Parameters:
      discounts - the discounts
      Returns:
      DiscountsWSResponseDTO discount
    • populateTaxes

      protected List<Tax> populateTaxes(List<TaxData> taxes)
      populate taxes
      Parameters:
      taxes - the taxes
      Returns:
      list of TaxesWSResponseDTO
    • populatePrice

      protected Price populatePrice(PriceData baseFare)
      populate price
      Parameters:
      baseFare - the base fare
      Returns:
      PricesWSResponseDTO price
    • populateProductData

      protected BasicProduct populateProductData(OfferPricingInfoData offerPricingInfoData, OfferGroupData offerGroupData)
      get product data
      Parameters:
      offerPricingInfoData - the offer pricing info data
      offerGroupData - the offer group data
      Returns:
      AncillaryProductWSResponseDTO basic product
    • populateProductCategory

      protected List<Category> populateProductCategory(Collection<CategoryData> categoryDataList, OfferGroupData offerGroupData)
      get Product Category
      Parameters:
      categoryDataList - the category data list
      offerGroupData - the offer group data
      Returns:
      list of CategoriesWSResponseDTO
    • populateDataReference

      protected AncillaryDataReference populateDataReference(OfferResponseData offerResponseData)
      populate Data Reference
      Parameters:
      offerResponseData - the offer response data
      Returns:
      DataReferenceWSResponseDTO data reference
    • populateTransportOfferingDetails

      protected void populateTransportOfferingDetails(ItineraryData itineraryData, AncillaryDataReference dataReference, List<Transport> transportList)
      get Transport Offering Details
      Parameters:
      itineraryData - the itinerary data
      dataReference - the data reference
      transportList - the list of transport offering
    • getPassengerDetails

      protected void getPassengerDetails(ItineraryData itineraryData, AncillaryDataReference dataReference, List<BasicTraveller> passengers)
      get Passenger Details
      Parameters:
      itineraryData - the itinerary data
      dataReference - the data reference
      passengers - the passengers
    • hasDefaultRestriction

      protected boolean hasDefaultRestriction(TravelRestrictionData travelRestrictionData)
      Checks if the given restriction has the default values
      Parameters:
      travelRestrictionData - the travelRestrictionData
      Returns:
      true if has the default restriction values