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 Details

    • PackageSearchRequestValidator

      public PackageSearchRequestValidator()
  • 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
    • 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

      protected String 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 occupancy
      errors -
    • 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

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