Class RbDurationUnitFormatter

java.lang.Object
com.norconex.commons.lang.time.RbDurationUnitFormatter
All Implemented Interfaces:
DurationUnitFormatter

public class RbDurationUnitFormatter extends Object implements DurationUnitFormatter

Use localized properties files (ResourceBundle) to get the string representation of duration unit. Each properties file is expected to have the following keys, their plural versions being optional (if a plural unit is spelled the same as singular).

If a key is not found, the toString() version of the unit will be returned. If locale is null, the default locale will be use. If the unit is null, null will be returned.

  • year
  • years
  • month
  • months
  • week
  • weeks
  • day
  • days
  • hour
  • hours
  • minute
  • minutes
  • second
  • seconds
  • millisecond
  • milliseconds
Since:
2.0.0