Class TimeZoneAliases

java.lang.Object
io.deephaven.time.TimeZoneAliases

public class TimeZoneAliases extends Object
TimeZoneAliases provides a service to look up time zones based on alias names and to format time zones to their aliased names.
  • Constructor Details

    • TimeZoneAliases

      public TimeZoneAliases()
  • Method Details

    • zoneId

      @NotNull public static @NotNull ZoneId zoneId(@NotNull @NotNull String timeZone)
      Gets the time zone id for a time zone name.
      Parameters:
      timeZone - time zone name.
      Returns:
      time zone.
    • zoneName

      @NotNull public static @NotNull String zoneName(@NotNull @NotNull ZoneId timeZone)
      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

      @NotNull public static @NotNull Map<String,ZoneId> 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

      public static void addAlias(@NotNull @NotNull String alias, @NotNull @NotNull String zoneId)
      Adds a new time zone alias.
      Parameters:
      alias - alias name
      zoneId - time zone id name
      Throws:
      IllegalArgumentException - if the alias already exists or the time zone is invalid
    • rmAlias

      public static boolean rmAlias(@NotNull @NotNull String alias)
      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