Class RBDurationUnitFormatter

  • All Implemented Interfaces:
    IDurationUnitFormatter

    public class RBDurationUnitFormatter
    extends Object
    implements IDurationUnitFormatter

    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
    Author:
    Pascal Essiembre