Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Oct 4, 2023
1 parent 44a38f7 commit a2dddef
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
public class TimeUnitUtil {

public static TimeUnit toTimeUnit(final VncKeyword unit) {
if (unit == null) {
throw new VncException(
"No time-unit! " +
"Use one of :millis, :seconds, :minutes, :hours, :days.");
}

switch(unit.getValue()) {
case "milli": return TimeUnit.MILLISECONDS;
case "millis": return TimeUnit.MILLISECONDS;
Expand All @@ -49,8 +55,8 @@ public static TimeUnit toTimeUnit(final VncKeyword unit) {

default:
throw new VncException(
"Invalid time-unit " + unit.getValue() +
"! Use one of :millis, :seconds, :minutes, :hours, :days.");
"Invalid time-unit " + unit.getValue() + "! " +
"Use one of :millis, :seconds, :minutes, :hours, :days.");
}
}

Expand Down

0 comments on commit a2dddef

Please sign in to comment.