Class AccommodationSearchRequestValidator
java.lang.Object
de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
de.hybris.platform.coreaccommodationocc.validators.AccommodationSearchRequestValidator
- All Implemented Interfaces:
TravelValidator,org.springframework.validation.Validator
public class AccommodationSearchRequestValidator
extends AbstractTravelValidator
implements org.springframework.validation.Validator
Validates instances of
AccommodationSearchRequest for the valid destination location, check in date, check out date
and the room stay details-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturn the current time in given formatbooleanvoidprotected voidvalidateCheckInDate(String checkInDate, org.springframework.validation.Errors errors) Validate the Check In date is after the current time.protected voidvalidateCheckOutDate(String checkInDate, String checkOutDate, org.springframework.validation.Errors errors) Validate the checkout date is after the check in date and maximum room stay daysprotected 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 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
-
AccommodationSearchRequestValidator
public AccommodationSearchRequestValidator()
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
validateCheckOutDate
protected void validateCheckOutDate(String checkInDate, String checkOutDate, org.springframework.validation.Errors errors) Validate the checkout date is after the check in date and maximum room stay days- Parameters:
checkInDate-checkOutDate-errors-
-
validateCheckInDate
protected void validateCheckInDate(String checkInDate, org.springframework.validation.Errors errors) Validate the Check In date is after the current time.- Parameters:
checkInDate-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:
-