Enum Class Format
- All Implemented Interfaces:
Serializable,Comparable<Format>,Constable
Values for the
format attribute on <relative-time>.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
-
Enum Constant Details
-
RELATIVE
Relative phrase ("3 days ago"). UsesIntl.RelativeTimeFormatunder the hood and collapses past times under ~55 seconds to "now" regardless of thePrecisionsetting. This is a signed-int threshold in the upstream element, not something the wrapper can override. If you need continuous second-by-second ticking from zero, useDURATIONorMICRO. -
DURATION
Duration breakdown ("3d 4h", "1m 5s"). Ticks every second from zero with no "now" threshold, making it the right choice for live elapsed-time displays. Re-renders on every second boundary while the displayed value contains seconds. -
DATETIME
Absolute formatted date-time. Does not tick: once rendered, the displayed string doesn't change unless the inputs do. UsesetTimeZone,setTimeZoneName, and the per-part setters (setYear, etc.) to shape the output. -
AUTO
Alias forRELATIVE(the upstream default). Same behaviour, same "now" plateau for past times under ~55 seconds. -
ELAPSED
Elapsed-time style. Routes through the same duration-format path asDURATION; ticks second-by-second with no "now" threshold. -
MICRO
Compact single-unit form ("3d", "5h", "2m"). Re-renders only when the displayed unit changes, so it ticks less frequently thanDURATION. Good when space is tight (badges, table cells).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-