public final class DaysToWorkingDaysConverter extends Object
TimeIntervalColumnHeaders the converter creates a "table" with integer that represents the age in days from
the largest lower limit until the smallest upper limit of the timeIntervalColumnHeaders. This table is valid for a
whole day until the converter is initialized with bigger limits.| Modifier and Type | Method and Description |
|---|---|
int |
convertDaysToWorkingDays(int ageInDays)
Converts an integer, that represents the age in days, to the age in working days by using the table that was
created by initialization.
|
long |
convertWorkingDaysToDays(java.time.Instant startTime,
long numberOfDays) |
ArrayList<Integer> |
convertWorkingDaysToDays(int ageInWorkingDays)
Converts an integer, that represents the age in working days, to the age in days by using the table that was
created by initialization.
|
List<java.time.LocalDate> |
getCustomHolidays() |
java.time.LocalDate |
getEasterSunday(int year)
Computes the date of Easter Sunday for a given year.
|
static DaysToWorkingDaysConverter |
initialize(List<TimeIntervalColumnHeader> columnHeaders)
Initializes the DaysToWorkingDaysConverter for a list of
TimeIntervalColumnHeaders and the current day. |
static DaysToWorkingDaysConverter |
initialize(List<TimeIntervalColumnHeader> columnHeaders,
java.time.Instant referenceDate)
Initializes the DaysToWorkingDaysConverter for a list of
TimeIntervalColumnHeaders and a referenceDate. |
boolean |
isGermanPublicHolidayEnabled() |
static void |
setCustomHolidays(List<java.time.LocalDate> holidays) |
static void |
setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled) |
public static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders) throws InvalidArgumentException
TimeIntervalColumnHeaders and the current day. A
new table is only created if there are bigger limits or the date has changed.columnHeaders - a list of TimeIntervalColumnHeaders that determines the size of the tableInvalidArgumentException - thrown if columnHeaders is nullpublic static DaysToWorkingDaysConverter initialize(List<TimeIntervalColumnHeader> columnHeaders, java.time.Instant referenceDate) throws InvalidArgumentException
TimeIntervalColumnHeaders and a referenceDate. A
new table is only created if there are bigger limits or the date has changed.columnHeaders - a list of TimeIntervalColumnHeaders that determines the size of the tablereferenceDate - a Instant that represents the current day of the tableInvalidArgumentException - thrown if columnHeaders or referenceDate is nullpublic int convertDaysToWorkingDays(int ageInDays)
ageInDays - represents the age in dayspublic ArrayList<Integer> convertWorkingDaysToDays(int ageInWorkingDays)
ageInWorkingDays - represents the age in working dayspublic long convertWorkingDaysToDays(java.time.Instant startTime,
long numberOfDays)
public java.time.LocalDate getEasterSunday(int year)
year - for which the date of Easter Sunday should be calculatedpublic static void setCustomHolidays(List<java.time.LocalDate> holidays)
public List<java.time.LocalDate> getCustomHolidays()
public static void setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled)
public boolean isGermanPublicHolidayEnabled()
Copyright © 2018. All rights reserved.