Class TransportSearchRequestValidator
java.lang.Object
de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
de.hybris.platform.coretransportocc.validators.TransportSearchRequestValidator
- All Implemented Interfaces:
TravelValidator,org.springframework.validation.Validator
public class TransportSearchRequestValidator
extends AbstractTravelValidator
implements org.springframework.validation.Validator
Validates instances of
FareSearchRequest for the valid departureDate,transportOfferingType,returnDate of return
trip,passengerQuantity format,locationType,cabinClass-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturn the current time in given formatbooleanvoidprotected booleanvalidateAdult(String passengerType) Validate the adult is present in passenger quantity.protected voidvalidateDepartureDate(String departureDate, org.springframework.validation.Errors errors) Validate the departure date is after the current time.protected booleanvalidateLocation(String location) Validate the locationprotected booleanvalidateLocationType(String locationType) Validate the location typeprotected booleanvalidatePassengerQuantity(String passengerType) Validate the passenger type.protected voidvalidateReturnDate(String departureDate, String returnDate, org.springframework.validation.Errors errors) Validate the return date is after the departure dateprotected booleanvalidateTransportOfferingType(String transportOfferingType) Validate the transport offering typeprotected voidvalidateTripeTypeAndReturnDate(String tripType, String returnDate, org.springframework.validation.Errors errors) Validate the trip typeMethods inherited from class de.hybris.platform.coretravelbasewebservicescommons.validators.AbstractTravelValidator
getErrorId, getErrorMessage, getFieldPath, isOptional, isValidationRequired, reject, setErrorId, setErrorMessage, setFieldPath, setOptional, validate
-
Constructor Details
-
TransportSearchRequestValidator
public TransportSearchRequestValidator()
-
-
Method Details
-
supports
- Specified by:
supportsin interfaceorg.springframework.validation.Validator
-
validate
- Specified by:
validatein interfaceorg.springframework.validation.Validator
-
validateAdult
Validate the adult is present in passenger quantity.- Parameters:
passengerType- the passenger type- Returns:
- the boolean
-
validateReturnDate
protected void validateReturnDate(String departureDate, String returnDate, org.springframework.validation.Errors errors) Validate the return date is after the departure date- 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- the departure dateerrors- the errors
-
getCurrentTimeStamp
Return the current time in given format- Returns:
-
validateTripeTypeAndReturnDate
protected void validateTripeTypeAndReturnDate(String tripType, String returnDate, org.springframework.validation.Errors errors) Validate the trip type- Parameters:
tripType-returnDate-errors-
-
validateLocationType
Validate the location type- Parameters:
locationType-- Returns:
-
validateTransportOfferingType
Validate the transport offering type- Parameters:
transportOfferingType-- Returns:
-
validatePassengerQuantity
Validate the passenger type.- Parameters:
passengerType- the passenger type- Returns:
- the boolean
-
validateLocation
Validate the location- Parameters:
location-- Returns:
-