Package io.deephaven.time
Class TimeZoneAliases
java.lang.Object
io.deephaven.time.TimeZoneAliases
TimeZoneAliases provides a service to look up time zones based on alias names and to format time zones to their
aliased names.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Adds a new time zone alias.Gets a map of all time zone names to their respective time zones.static boolean
Removes a time zone alias.static @NotNull ZoneId
Gets the time zone id for a time zone name.static @NotNull String
Gets the name for a time zone.
-
Constructor Details
-
TimeZoneAliases
public TimeZoneAliases()
-
-
Method Details
-
zoneId
Gets the time zone id for a time zone name.- Parameters:
timeZone
- time zone name.- Returns:
- time zone.
-
zoneName
Gets the name for a time zone. If an alias is present, the alias is returned. If not, the zone id name is returned.- Parameters:
timeZone
- time zone.- Returns:
- name for the time zone. If an alias is present, the alias is returned. If not, the zone id name is returned.
-
getAllZones
Gets a map of all time zone names to their respective time zones.- Returns:
- map of all time zone names to their respective time zones.
-
addAlias
Adds a new time zone alias.- Parameters:
alias
- alias namezoneId
- time zone id name- Throws:
IllegalArgumentException
- if the alias already exists or the time zone is invalid
-
rmAlias
Removes a time zone alias.- Parameters:
alias
- alias name.- Returns:
- true if the alias was present; false if the alias was not present.
- Throws:
IllegalArgumentException
- if the alias already exists or the time zone is invalid
-