Package | Description |
---|---|
com.norconex.commons.lang.time |
Time-related utility classes.
|
Modifier and Type | Method and Description |
---|---|
static DurationUnit |
DurationUnit.from(Duration duration)
Gets the largest unit fitting in the provided duration.
|
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(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 type with the specified name.
|
static DurationUnit[] |
DurationUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
String |
IDurationUnitFormatter.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.
|
Copyright © 2008–2023 Norconex Inc.. All rights reserved.