public final class DaysToWorkingDaysConverter extends Object
ReportLineItemDefinitions 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 reportLineItemDefinitions. 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.
|
int |
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<ReportLineItemDefinition> reportLineItemDefinitions)
Initializes the DaysToWorkingDaysConverter for a list of
ReportLineItemDefinitions and the current day. |
static DaysToWorkingDaysConverter |
initialize(List<ReportLineItemDefinition> reportLineItemDefinitions,
java.time.Instant referenceDate)
Initializes the DaysToWorkingDaysConverter for a list of
ReportLineItemDefinitions and a referenceDate. |
boolean |
isGermanPublicHolidayEnabled() |
static void |
setCustomHolidays(List<java.time.LocalDate> holidays) |
static void |
setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled) |
public static DaysToWorkingDaysConverter initialize(List<ReportLineItemDefinition> reportLineItemDefinitions) throws InvalidArgumentException
ReportLineItemDefinitions and the current day. A
new table is only created if there are bigger limits or the date has changed.reportLineItemDefinitions - a list of ReportLineItemDefinitions that determines the size of the tableInvalidArgumentException - thrown if reportLineItemDefinitions is nullpublic static DaysToWorkingDaysConverter initialize(List<ReportLineItemDefinition> reportLineItemDefinitions, java.time.Instant referenceDate) throws InvalidArgumentException
ReportLineItemDefinitions and a referenceDate. A
new table is only created if there are bigger limits or the date has changed.reportLineItemDefinitions - a list of ReportLineItemDefinitions that determines the size of the tablereferenceDate - a Instant that represents the current day of the tableInvalidArgumentException - thrown if reportLineItemDefinitions or referenceDate is nullpublic int convertDaysToWorkingDays(int ageInDays)
ageInDays - represents the age in dayspublic int convertWorkingDaysToDays(int ageInWorkingDays)
ageInWorkingDays - represents the age in working dayspublic 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.