Class DefaultTravellerCartQuantityValidationStrategy
java.lang.Object
de.hybris.platform.travelfacades.strategies.impl.DefaultTravellerCartQuantityValidationStrategy
- All Implemented Interfaces:
AddTravellerToCartValidationStrategy
public class DefaultTravellerCartQuantityValidationStrategy
extends Object
implements AddTravellerToCartValidationStrategy
Strategy to validate the cart and the quantity of the new travellers.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected de.hybris.platform.order.CartServiceGets cart service.protected de.hybris.platform.servicelayer.config.ConfigurationServiceGets configuration service.voidsetCartService(de.hybris.platform.order.CartService cartService) Sets cart service.voidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.voidvalidate(TravellerQuantityListData travellerQuantityListData) Validates if 1) the cart is empty 2) the sum of the new quantity and the number of the travellers already present in the cart is equal or less than 20 (maximum number of passengers).
-
Constructor Details
-
DefaultTravellerCartQuantityValidationStrategy
public DefaultTravellerCartQuantityValidationStrategy()
-
-
Method Details
-
validate
public void validate(TravellerQuantityListData travellerQuantityListData) throws AddTravellerToCartException, InvalidSessionCartException Validates if 1) the cart is empty 2) the sum of the new quantity and the number of the travellers already present in the cart is equal or less than 20 (maximum number of passengers).- Specified by:
validatein interfaceAddTravellerToCartValidationStrategy- Parameters:
travellerQuantityListData- the travellerQuantityListData- Throws:
AddTravellerToCartExceptionInvalidSessionCartException
-
getCartService
protected de.hybris.platform.order.CartService getCartService()Gets cart service.- Returns:
- the cart service
-
setCartService
public void setCartService(de.hybris.platform.order.CartService cartService) Sets cart service.- Parameters:
cartService- the cart service
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()Gets configuration service.- Returns:
- the configuration service
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.- Parameters:
configurationService- the configuration service
-