Class FlightSearchRequestValidator
java.lang.Object
de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
de.hybris.platform.coretravelbasewebservicescommons.validators.TravelCompositeValidator
de.hybris.platform.coreairlineocc.validators.FlightSearchRequestValidator
- All Implemented Interfaces:
TravelValidator,org.springframework.validation.Validator
Validates instances of
FlightSearchRequest for the valid
departureDate,
passengerQuantity format,locationType-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CabinClassServiceGets cabin class service.protected PassengerTypeServiceprotected TransportFacilityFacadeget transport facility facadeprotected TravelLocationFacadeGet travel location facadeprotected DateParse string to date.voidsetCabinClassService(CabinClassService cabinClassService) Sets cabin class service.voidsetPassengerTypeService(PassengerTypeService passengerTypeService) voidsetTransportFacilityFacade(TransportFacilityFacade transportFacilityFacade) set transport facility facadevoidsetTravelLocationFacade(TravelLocationFacade travelLocationFacade) Set the travel location facadebooleanprotected DatevalidateDepartureDate(String departureDate, Date outboundDate, org.springframework.validation.Errors errors) Validate the departure date is after the current time.voidvalidateInternal(Object target, org.springframework.validation.Errors errors) Internal method for validating the suppliedtargetobjectprotected booleanvalidateLocation(String location) Validate the locationprotected booleanvalidatePassengerQuantity(List<SearchPassengerPreferences> passengerType) Validate the passenger type.protected booleanvalidatePassengers(List<SearchPassengerPreferences> passengerType, org.springframework.validation.Errors errors) Validate the adult is present in passenger quantity.Methods inherited from class de.hybris.platform.coretravelbasewebservicescommons.validators.TravelCompositeValidator
getTargetField, getValidators, isSupport, popNestedPath, pushNestedPath, setValidators, validate, validate, validateInternalMethods inherited from class de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
getErrorId, getErrorMessage, getFieldPath, isOptional, isValidationRequired, reject, setErrorId, setErrorMessage, setFieldPath, setOptional
-
Constructor Details
-
FlightSearchRequestValidator
public FlightSearchRequestValidator()
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator- Overrides:
supportsin classTravelCompositeValidator
-
validateInternal
Description copied from class:TravelCompositeValidatorInternal method for validating the suppliedtargetobject- Overrides:
validateInternalin classTravelCompositeValidator- Parameters:
target- the object that is to be validatederrors- contextual state about the validation process
-
validatePassengers
protected boolean validatePassengers(List<SearchPassengerPreferences> passengerType, org.springframework.validation.Errors errors) Validate the adult is present in passenger quantity.- Parameters:
passengerType- the passenger type- Returns:
- the boolean
-
validateDepartureDate
protected Date validateDepartureDate(String departureDate, Date outboundDate, org.springframework.validation.Errors errors) Validate the departure date is after the current time.- Parameters:
departureDate- the departure date of the segmentoutboundDate- the outbound dateerrors- contextual state about the validation process- Returns:
- the outbound date
-
validatePassengerQuantity
Validate the passenger type.- Parameters:
passengerType- the passenger type- Returns:
- the boolean
-
validateLocation
Validate the location- Parameters:
location-- Returns:
-
parseDate
Parse string to date.- Parameters:
date- the date- Returns:
- date
-
getTravelLocationFacade
Get travel location facade- Returns:
- the travel location facade
-
setTravelLocationFacade
Set the travel location facade- Parameters:
travelLocationFacade- the travel location facade
-
getTransportFacilityFacade
get transport facility facade- Returns:
- the transport facility facade
-
setTransportFacilityFacade
set transport facility facade- Parameters:
transportFacilityFacade- the transport facility facade
-
getCabinClassService
Gets cabin class service.- Returns:
- the cabin class service
-
setCabinClassService
Sets cabin class service.- Parameters:
cabinClassService- the cabin class service
-
getPassengerTypeService
- Returns:
- the passengerTypeService
-
setPassengerTypeService
- Parameters:
passengerTypeService- the passengerTypeService to set
-