Class DefaultIntelliPricerPassengerTypeGroupHandler
java.lang.Object
de.hybris.platform.prosfacades.fare.price.handlers.impl.DefaultIntelliPricerPassengerTypeGroupHandler
- All Implemented Interfaces:
IntelliPricerRequestHandler
public class DefaultIntelliPricerPassengerTypeGroupHandler
extends Object
implements IntelliPricerRequestHandler
The implementation of
IntelliPricerRequestHandler interface. This class populates the passenger type and group lists.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LinkedHashSet<PassengerGroup>createPassengerGroups(List<PassengerData> passengerDataList, Map<String, Integer> paxTypeIdMap) Create passenger groups set.protected PassengerTypecreatePassengerType(String ptcCode, int passengerTypeId) Creates a passenger type.protected LinkedHashSet<PassengerType>createPassengerTypes(List<PassengerData> passengerDataList, Map<String, Integer> paxTypeIdMap) Creates the passenger types set from a passenger data.Gets passenger code to pax type mapping.voidhandle(AddSolutionRequestData addSolutionRequestData, IntelliPricerRequest intelliPricerRequest) Creates the list of passenger types and groups from the passenger list.voidsetPassengerCodeToPaxTypeMapping(Map<String, String> passengerCodeToPaxTypeMapping) Sets passenger code to pax type mapping.
-
Constructor Details
-
DefaultIntelliPricerPassengerTypeGroupHandler
public DefaultIntelliPricerPassengerTypeGroupHandler()
-
-
Method Details
-
handle
public void handle(AddSolutionRequestData addSolutionRequestData, IntelliPricerRequest intelliPricerRequest) throws FarePriceException Creates the list of passenger types and groups from the passenger list.- Specified by:
handlein interfaceIntelliPricerRequestHandler- Parameters:
addSolutionRequestData- the addSolutionRequestDataintelliPricerRequest- the intelliPricerRequest- Throws:
FarePriceException
-
createPassengerGroups
protected LinkedHashSet<PassengerGroup> createPassengerGroups(List<PassengerData> passengerDataList, Map<String, Integer> paxTypeIdMap) Create passenger groups set.- Parameters:
passengerDataList- the passenger data listpaxTypeIdMap- the pax type id map- Returns:
- the set of passenger groups/
-
createPassengerTypes
protected LinkedHashSet<PassengerType> createPassengerTypes(List<PassengerData> passengerDataList, Map<String, Integer> paxTypeIdMap) throws FarePriceExceptionCreates the passenger types set from a passenger data. For each distinct type of passenger, an entry (ptcCode,passengerTypeId) is added into the paxTypeIdMap, in order to create the passenger groups.- Parameters:
passengerDataList- the passenger data listpaxTypeIdMap- the pax type id map- Returns:
- the set of passenger types
- Throws:
FarePriceException- the fare price exception if an error occurs during the creation of a passenger type.
-
createPassengerType
protected PassengerType createPassengerType(String ptcCode, int passengerTypeId) throws FarePriceException Creates a passenger type.- Parameters:
ptcCode- the ptc codepassengerTypeId- the passenger type id- Returns:
- the passenger type
- Throws:
FarePriceException- the fare price exception if the passeger type is not a valid type for the intelliPricerRequest.
-
getPassengerCodeToPaxTypeMapping
Gets passenger code to pax type mapping.- Returns:
- the passenger code to pax type mapping
-
setPassengerCodeToPaxTypeMapping
Sets passenger code to pax type mapping.- Parameters:
passengerCodeToPaxTypeMapping- the passenger code to pax type mapping
-