/** * Returns a time period property using the format defined in * {@link ISOPeriodFormat#standard()}. * * @param key * the property key. * * @return the {@link Period}. */ public Period getPeriodProperty(String key) { String property = getProperty(key); if (property == null) { return null; } else { return new Period(property); } }
/** * Returns a time duration property using the format defined in * {@link ISOPeriodFormat#standard()}. * * @param key * the property key. * * @return the {@link Duration}. */ public Duration getDurationProperty(String key) { String property = getProperty(key); if (property == null) { return null; } else { return new Period(property).toStandardDuration(); } }
/** * Returns a time period property using the format defined in * {@link ISOPeriodFormat#standard()}. * * @param key * the property key. * * @param formatter * the {@link PeriodFormatter} that parses the period property. * * @return the {@link Period}. */ public Period getPeriodProperty(String key, PeriodFormatter formatter) { String property = getProperty(key); if (property == null) { return null; } else { return formatter.parsePeriod(property); } }
/** * Returns a time duration property using the format defined in * {@link ISODurationFormat#standard()}. * * @param key * the property key. * * @param formatter * the {@link PeriodFormatter} that parses the duration property. * * @return the {@link Duration}. */ public Duration getDurationProperty(String key, PeriodFormatter formatter) { String property = getProperty(key); if (property == null) { return null; } else { return formatter.parsePeriod(property).toStandardDuration(); } }