# Uses of Enum Class
com.norconex.commons.lang.time.DurationUnit

Packages that use DurationUnit
Package
Description
com.norconex.commons.lang.time
Time-related utility classes.

- ## Uses of DurationUnit in com.norconex.commons.lang.time

  Methods in com.norconex.commons.lang.time that return DurationUnit
  Modifier and Type
  Method
  Description
  `static DurationUnit`
  DurationUnit.`from(long duration)`
  Gets the largest unit fitting in the provided duration.
  `static DurationUnit`
  DurationUnit.`from(String unit)`
  Gets the DurationUnit matching the provided string (case insensitive) or `null` if there are no units matching.
  `static DurationUnit`
  DurationUnit.`from(Duration duration)`
  Gets the largest unit fitting in the provided duration.
  `static DurationUnit`
  DurationUnit.`from(TemporalUnit temporalUnit)`
  `DurationUnit`
  DurationFormatter.`getHighestUnit()`
  `DurationUnit`
  DurationFormatter.`getLowestUnit()`
  `static DurationUnit[]`
  DurationUnit.`reverseValues()`
  Returns all units from the highest (year), to the smallest (milliseconds).
  `static DurationUnit`
  DurationUnit.`valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static DurationUnit[]`
  DurationUnit.`values()`
  Returns an array containing the constants of this enum class, in the order they are declared.
  Methods in com.norconex.commons.lang.time with parameters of type DurationUnit
  Modifier and Type
  Method
  Description
  `String`
  DurationUnitFormatter.`format(DurationUnit unit, Locale locale, boolean plural)`
  Format a duration unit
  `String`
  RbDurationUnitFormatter.`format(DurationUnit unit, Locale locale, boolean plural)`
  `long`
  DurationUnit.`toUnit(DurationUnit targetUnit, long amount)`
  `DurationFormatter`
  DurationFormatter.`withHighestUnit(DurationUnit highestUnit)`
  Creates a copy if this formatter with the given highest unit.
  `DurationFormatter`
  DurationFormatter.`withLowestUnit(DurationUnit lowestUnit)`
  Creates a copy if this formatter with the given lowest unit.