Class TimezoneConfiguration

Object
ch.aaap.harvestclient.core.TimezoneConfiguration

public class TimezoneConfiguration extends Object
Keeps a list of supported harvest timezones and has methods to converted them to ZoneOffsets.
  • Constructor Details

    • TimezoneConfiguration

      public TimezoneConfiguration(InputStream in)
  • Method Details

    • isValidName

      public boolean isValidName(String timezone)
      Parameters:
      timezone - the name of a timezone
      Returns:
      true if the timezone will be recognized by Harvest
    • getZoneId

      public Optional<ZoneId> getZoneId(String timezone)
      Parameters:
      timezone - the name of a timezone as recognized by Harvest
      Returns:
      a Zoneoffset if the timezone is valid, Optional.empty() otherwise
    • getHarvestName

      public Optional<String> getHarvestName(ZoneId zoneId)
      Note: there is no one-to-one correspondence between Harvest timezones and ZoneIds: this function returns the last one seen in timezones.txt
      Parameters:
      zoneId - the ZoneId
      Returns:
      the name of an Harvest timezone that maps back to this zoneId