Class PackageSearchRequestValidator
java.lang.Object
de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
de.hybris.platform.coretravelpackagesocc.validators.PackageSearchRequestValidator
- All Implemented Interfaces:
TravelValidator,org.springframework.validation.Validator
public class PackageSearchRequestValidator
extends AbstractTravelValidator
implements org.springframework.validation.Validator
Validates instances of
AccommodationSearch for the valid departure & arrival location, departure date, return date
and the room stay details-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturn the current time in given formatbooleanvoidprotected voidvalidateDepartureDate(String departureDate, org.springframework.validation.Errors errors) Validate the departure date is after the current time.protected booleanvalidateLocationPattern(String location) Validate the locationprotected intvalidatePax(org.springframework.validation.Errors errors, int numberOfPaX, String passengerTypeInfo) validate Pax format and minimum 1 adult per room checkprotected voidvalidateReturnDate(String departureDate, String returnDate, org.springframework.validation.Errors errors) Validate the return date is after the departure date and maximum room stay daysprotected voidvalidateRoomGuestOccupancy(String roomGuestOccupancy, org.springframework.validation.Errors errors) Validate the room guest occupancyMethods inherited from class de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
getErrorId, getErrorMessage, getFieldPath, isOptional, isValidationRequired, reject, setErrorId, setErrorMessage, setFieldPath, setOptional, validate
-
Constructor Details
-
PackageSearchRequestValidator
public PackageSearchRequestValidator()
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
validateReturnDate
protected void validateReturnDate(String departureDate, String returnDate, org.springframework.validation.Errors errors) Validate the return date is after the departure date and maximum room stay days- Parameters:
departureDate-returnDate-errors-
-
validateDepartureDate
protected void validateDepartureDate(String departureDate, org.springframework.validation.Errors errors) Validate the departure date is after the current time.- Parameters:
departureDate-errors-
-
getCurrentTimeStamp
Return the current time in given format- Returns:
-
validateRoomGuestOccupancy
protected void validateRoomGuestOccupancy(String roomGuestOccupancy, org.springframework.validation.Errors errors) Validate the room guest occupancy- Parameters:
roomGuestOccupancy- the room guest occupancyerrors-
-
validatePax
protected int validatePax(org.springframework.validation.Errors errors, int numberOfPaX, String passengerTypeInfo) validate Pax format and minimum 1 adult per room check- Parameters:
errors-numberOfPaX-passengerTypeInfo-
-
validateLocationPattern
Validate the location- Parameters:
location-- Returns:
-