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 Details

    • TransportSearchRequestValidator

      public TransportSearchRequestValidator()
  • Method Details

    • supports

      public boolean supports(Class<?> aClass)
      Specified by:
      supports in interface org.springframework.validation.Validator
    • validate

      public void validate(Object target, org.springframework.validation.Errors errors)
      Specified by:
      validate in interface org.springframework.validation.Validator
    • validateAdult

      protected boolean validateAdult(String passengerType)
      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 date
      errors - the errors
    • getCurrentTimeStamp

      protected String 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

      protected boolean validateLocationType(String locationType)
      Validate the location type
      Parameters:
      locationType -
      Returns:
    • validateTransportOfferingType

      protected boolean validateTransportOfferingType(String transportOfferingType)
      Validate the transport offering type
      Parameters:
      transportOfferingType -
      Returns:
    • validatePassengerQuantity

      protected boolean validatePassengerQuantity(String passengerType)
      Validate the passenger type.
      Parameters:
      passengerType - the passenger type
      Returns:
      the boolean
    • validateLocation

      protected boolean validateLocation(String location)
      Validate the location
      Parameters:
      location -
      Returns: