* @throws InvalidArgumentException if any of the parameters are negative
* values.
*/
public long timeToSeconds(final int days, final int hours, final int minutes, final int seconds) throws InvalidArgumentException {
if (days < 0) {
throw new InvalidArgumentException("Days must be larger than zero.");
}
if (hours < 0) {
throw new InvalidArgumentException("Hours must be larger than zero.");
}
if (minutes < 0) {
throw new InvalidArgumentException("Minutes must be larger than zero.");
}
if (seconds < 0) {
throw new InvalidArgumentException("Seconds must be larger than zero.");
}
return seconds + (ONE_MINUTE * minutes) + (ONE_MINUTE * ONE_HOUR * hours) + (ONE_MINUTE * ONE_HOUR * ONE_DAY * days);
}