Package org.apache.juneau.marshall
Enum Class TimeZoneFormat
- All Implemented Interfaces:
Serializable,Comparable<TimeZoneFormat>,Constable
Supported wire formats for
TimeZone and ZoneId values.
Used by MarshallingContext.Builder.timeZoneFormat(TimeZoneFormat),
Marshalled.timeZoneFormat(),
MarshalledProp.timeZoneFormat(), and
MarshalledConfig.timeZoneFormat() to control how time-zone
identifiers are written to and read from the wire.
The default is ID which preserves the historical wire output produced before this enum existed
(TimeZone.getID() / ZoneId.getId()).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe IANA zone id (the default):"America/Los_Angeles" ,"UTC" ,"GMT-08:00" .Default long display name inLocale.ROOT(formatting only; not always round-trippable):"Pacific Standard Time" .Default short display name inLocale.ROOT(formatting only; not always round-trippable):"PST" .Sentinel meaning "no value configured" — falls through to the next-higher precedence level. -
Method Summary
Modifier and TypeMethodDescriptionFormats the specifiedZoneIdusing this format.Formats the specifiedTimeZoneusing this format.static TimeZoneparseTimeZone(String value) Parses the specified wire value as aTimeZone.static ZoneIdparseZoneId(String value) Parses the specified wire value as aZoneId.static TimeZoneFormatReturns the enum constant of this class with the specified name.static TimeZoneFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOT_SET
Sentinel meaning "no value configured" — falls through to the next-higher precedence level. -
ID
The IANA zone id (the default):"America/Los_Angeles" ,"UTC" ,"GMT-08:00" . -
OFFSET
-
NAME_LONG
Default long display name inLocale.ROOT(formatting only; not always round-trippable):"Pacific Standard Time" .Parsing accepts any value that
ZoneId.of(String)understands; localized display names are not reverse-parsed. -
NAME_SHORT
Default short display name inLocale.ROOT(formatting only; not always round-trippable):"PST" .Parsing accepts any value that
ZoneId.of(String)understands; localized display names are not reverse-parsed.
-
-
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
-
format
Formats the specifiedTimeZoneusing this format.- Parameters:
value- The value to format. Can benull (returnsnull ).- Returns:
- The formatted string, or
null ifvalueisnull .
-
format
Formats the specifiedZoneIdusing this format.- Parameters:
value- The value to format. Can benull (returnsnull ).- Returns:
- The formatted string, or
null ifvalueisnull .
-
parseTimeZone
Parses the specified wire value as aTimeZone.- Parameters:
value- The wire value. Can benull or blank (returnsnull ).- Returns:
- The parsed
TimeZone, ornull ifvalueisnull or blank.
-
parseZoneId
Parses the specified wire value as aZoneId.- Parameters:
value- The wire value. Can benull or blank (returnsnull ).- Returns:
- The parsed
ZoneId, ornull ifvalueisnull or blank.
-