Class RemoveTravellerFromAmendmentValidationStrategy
java.lang.Object
de.hybris.platform.travelfacades.strategies.impl.RemoveTravellerFromAmendmentValidationStrategy
- All Implemented Interfaces:
RemoveTravellerFromCartValidationStrategy
public class RemoveTravellerFromAmendmentValidationStrategy
extends Object
implements RemoveTravellerFromCartValidationStrategy
Strategy to validate removal of traveller from amendment cart.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<TravellerModel>getActiveTravellers(CartModel sessionCart) Return list of active travellers from cart.protected de.hybris.platform.order.CartServiceGets cart service.protected booleanisAdultExistAfterRemove(List<TravellerModel> travellers) Is any adult traveller exist after removal of traveller.voidsetCartService(de.hybris.platform.order.CartService cartService) Sets cart service.voidValidates if 1) the cart is empty 2) traveller is not final traveller in the cart 3) cart does not contain child only after removal of traveller.
-
Constructor Details
-
RemoveTravellerFromAmendmentValidationStrategy
public RemoveTravellerFromAmendmentValidationStrategy()
-
-
Method Details
-
validate
public void validate(String travellerId) throws InvalidSessionCartException, InvalidTravellerException Validates if 1) the cart is empty 2) traveller is not final traveller in the cart 3) cart does not contain child only after removal of traveller.- Specified by:
validatein interfaceRemoveTravellerFromCartValidationStrategy- Parameters:
travellerId- the id of traveller- Throws:
InvalidSessionCartException- if session cart does not existInvalidTravellerException- if traveller linked to cart entry or its last adult in cart
-
getActiveTravellers
Return list of active travellers from cart.- Parameters:
sessionCart- the session cart- Returns:
- list of travellers
-
isAdultExistAfterRemove
Is any adult traveller exist after removal of traveller.- Parameters:
travellers- the list of travellers- Returns:
trueif any adult traveller exist after removal of traveller
-
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
-