Interface EphemerisManager


@NonNullByDefault public interface EphemerisManager
This service provides functionality around days of the year and is the central service to be used directly by others.
Author:
Gaƫl L'hopital - Initial contribution
  • Method Details

    • isWeekend

      boolean isWeekend(ZonedDateTime date)
      Tests given day status against configured weekend days
      Parameters:
      date - observed day
      Returns:
      whether the day is on weekend
    • isInDayset

      boolean isInDayset(String daysetName, ZonedDateTime date)
      Tests given day status against configured dayset
      Parameters:
      daysetName - name of the requested dayset, without prefix
      date - observed day
      Returns:
      whether the day is in the dayset
    • isBankHoliday

      boolean isBankHoliday(ZonedDateTime date)
      Tests given day status
      Parameters:
      date - observed day
      Returns:
      whether the day is bank holiday or not
    • isBankHoliday

      boolean isBankHoliday(ZonedDateTime date, URL resource)
      Tests given day status against given userfile
      Parameters:
      date - observed day
      url - bundle resource file containing holiday definitions
      Returns:
      whether the day is bank holiday or not
    • isBankHoliday

      boolean isBankHoliday(ZonedDateTime date, String filename) throws FileNotFoundException
      Tests given day status against given userfile
      Parameters:
      date - observed day
      source - absolute or relative path to the file on local file system
      Returns:
      whether the day is bank holiday or not
      Throws:
      FileNotFoundException
    • getBankHolidayName

      @Nullable String getBankHolidayName(ZonedDateTime date)
      Get given day name from given userfile
      Parameters:
      date - observed day
      Returns:
      name of the day or null if no corresponding entry
    • getBankHolidayName

      @Nullable String getBankHolidayName(ZonedDateTime date, URL resource)
      Get given day name from given userfile
      Parameters:
      date - observed day
      url - bundle resource file containing holiday definitions
      Returns:
      name of the day or null if no corresponding entry
    • getBankHolidayName

      @Nullable String getBankHolidayName(ZonedDateTime date, String filename) throws FileNotFoundException
      Get given day name from given userfile
      Parameters:
      date - observed day
      source - absolute or relative path to the file on local file system
      Returns:
      name of the day or null if no corresponding entry
      Throws:
      FileNotFoundException
    • getNextBankHoliday

      @Nullable String getNextBankHoliday(ZonedDateTime startDate)
      Gets the first next to come holiday in a 1 year time window
      Parameters:
      startDate - first day of the time window
      Returns:
      next coming holiday
    • getNextBankHoliday

      @Nullable String getNextBankHoliday(ZonedDateTime startDate, URL resource)
      Gets the first next to come holiday in a 1 year time window
      Parameters:
      startDate - first day of the time window
      url - bundle resource file containing holiday definitions
      Returns:
      next coming holiday
    • getNextBankHoliday

      @Nullable String getNextBankHoliday(ZonedDateTime startDate, String filename) throws FileNotFoundException
      Gets the first next to come holiday in a 1 year time window
      Parameters:
      startDate - first day of the time window
      source - absolute or relative path to the file on local file system
      Returns:
      next coming holiday
      Throws:
      FileNotFoundException
    • getHolidayDescription

      @Nullable String getHolidayDescription(@Nullable String holiday)
      Gets the localized holiday description
      Parameters:
      holidayName - code of searched holiday
      Returns:
      localized holiday description
    • getDaysUntil

      long getDaysUntil(ZonedDateTime from, String searchedHoliday)
      Gets the number of days until searchedHoliday
      Parameters:
      from - first day of the time window
      searchedHoliday - name of the searched holiday
      Returns:
      difference in days, -1 if not found
    • getDaysUntil

      long getDaysUntil(ZonedDateTime from, String searchedHoliday, URL resource)
      Gets the number of days until searchedHoliday in user file
      Parameters:
      from - first day of the time window
      searchedHoliday - name of the searched holiday
      url - bundle resource file containing holiday definitions
      Returns:
      difference in days, -1 if not found
    • getDaysUntil

      long getDaysUntil(ZonedDateTime from, String searchedHoliday, String filename) throws FileNotFoundException
      Gets the number of days until searchedHoliday in user file
      Parameters:
      from - first day of the time window
      searchedHoliday - name of the searched holiday
      source - absolute or relative path to the file on local file system
      Returns:
      difference in days, -1 if not found
      Throws:
      FileNotFoundException