src/main/java/org/sikuli/slides/api/interpreters/UnitConverter.java
public static TimeUnit extractTimeUnitFromString(String timeString){
		
		timeString=timeString.toLowerCase();
		
		if(timeString.contains("minute")){
			return TimeUnit.MINUTES;
		}
		else if(timeString.contains("microsecond")){
			return TimeUnit.MICROSECONDS;
		}
		else if(timeString.contains("millisecond")){
			return TimeUnit.MILLISECONDS;
		}
		else if(timeString.contains("second")){
			return TimeUnit.SECONDS;
		}
		else if(timeString.contains("hour")){
			return TimeUnit.HOURS;
		}		
		else if(timeString.toLowerCase().contains("day")){
			return TimeUnit.DAYS;
		}
		else
			return null;
	}
public static TimeUnit extractTimeUnitFromString(String timeString){
		
		timeString=timeString.toLowerCase();
		
		if(timeString.contains("minute")){
			return TimeUnit.MINUTES;
		}
		else if(timeString.contains("microsecond")){
			return TimeUnit.MICROSECONDS;
		}
		else if(timeString.contains("millisecond")){
			return TimeUnit.MILLISECONDS;
		}
		else if(timeString.contains("second")){
			return TimeUnit.SECONDS;
		}
		else if(timeString.contains("hour")){
			return TimeUnit.HOURS;
		}		
		else if(timeString.toLowerCase().contains("day")){
			return TimeUnit.DAYS;
		}
		else
			return null;
	}
public static TimeUnit extractTimeUnitFromString ( String timeString ) { timeString = timeString . toLowerCase ( ) ; if ( timeString . contains ( "minute" ) ) { return TimeUnit . MINUTES ; } else if ( timeString . contains ( "microsecond" ) ) { return TimeUnit . MICROSECONDS ; } else if ( timeString . contains ( "millisecond" ) ) { return TimeUnit . MILLISECONDS ; } else if ( timeString . contains ( "second" ) ) { return TimeUnit . SECONDS ; } else if ( timeString . contains ( "hour" ) ) { return TimeUnit . HOURS ; } else if ( timeString . toLowerCase ( ) . contains ( "day" ) ) { return TimeUnit . DAYS ; } else return null ; }
Extracts and returns the time unit from a string. If the string
doesn't include a unit, it returns null.
@param timeString the string that contains a time unit
@return the extracted time unit. If the string
doesn't include a unit, it returns null.
Extracts and returns the time unit from a string . If the string doesn t include a unit it returns null .