case 'h':
return base + dir * TimeUnit.HOURS.toMillis(offset);
case 'd':
return base + dir * TimeUnit.DAYS.toMillis(offset);
default:
throw new CommandInputError("Unsupported time type " + type);
}
}
if (arg.equalsIgnoreCase("min")) {
return 0L;
}
if (arg.equalsIgnoreCase("max")) {
return Long.MAX_VALUE;
}
return Long.parseLong(arg);
} catch (NumberFormatException e) {
throw new CommandInputError("Invalid number value: " + arg + ". Reason: " + e.getMessage());
}
}