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(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.
|
static DaysToWorkingDaysConverter |
initialize() |
static DaysToWorkingDaysConverter |
initialize(List<? extends TimeIntervalColumnHeader> columnHeaders)
Initializes the DaysToWorkingDaysConverter for a list of
TimeIntervalColumnHeaders and
the current day. |
static DaysToWorkingDaysConverter |
initialize(List<? extends TimeIntervalColumnHeader> columnHeaders,
Instant referenceDate)
Initializes the DaysToWorkingDaysConverter for a list of
TimeIntervalColumnHeaders and
a referenceDate. |
static void |
setCustomHolidays(List<LocalDate> holidays) |
static void |
setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled) |
String |
toString() |
public static DaysToWorkingDaysConverter initialize() throws InvalidArgumentException
InvalidArgumentExceptionpublic static DaysToWorkingDaysConverter initialize(List<? extends 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<? extends TimeIntervalColumnHeader> columnHeaders, 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 static void setGermanPublicHolidaysEnabled(boolean germanPublicHolidaysEnabled)
public int convertDaysToWorkingDays(int ageInDays)
ageInDays - represents the age in dayspublic ArrayList<Integer> convertWorkingDaysToDays(int ageInWorkingDays)
ageInWorkingDays - represents the age in working dayspublic long convertWorkingDaysToDays(Instant startTime, long numberOfDays)
Copyright © 2020. All rights reserved.