private void parseDuration(String dur) { Matcher matcher = durPattern.matcher(dur); if (!matcher.matches()) { throw new IllegalArgumentException("Not a valid duration: " + dur); } negative = "-".equals(matcher.group(SIGN)); years = intValue(matcher.group(YEARS)); months = intValue(matcher.group(MONTHS)); days = intValue(matcher.group(DAYS)); hours = intValue(matcher.group(HOURS)); minutes = intValue(matcher.group(MINUTES)); seconds = bigDecimalValue(matcher.group(SECONDS)); }