public static void validateDuration ( final String duration ) { try { if ( StringUtils . hasText ( duration ) ) { convertDurationToLocalTime ( duration ) ; } } catch ( final DateTimeParseException e ) { throw new InvalidMaintenanceScheduleException ( "Provided duration is not valid" , e , e . getErrorIndex ( ) ) ; } }
Validates the format of the maintenance window duration