Class WorkingDaysToDaysReportConverter
java.lang.Object
pro.taskana.monitor.internal.preprocessor.WorkingDaysToDaysReportConverter
The DaysToWorkingDaysReportConverter provides a method to convert an age in days into an age in
working days. Before the method convertDaysToWorkingDays() can be used, the
WorkingDaysToDaysReportConverter has to be initialized. For a list of 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.
-
Method Summary
Modifier and TypeMethodDescriptionintconvertDaysToWorkingDays(int amountOfDays) convertWorkingDaysToDays(int amountOfWorkdays) generateDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate) initialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator) initialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator, Instant referenceDate) Initializes the WorkingDaysToDaysConverter for a list of TimeIntervalColumnHeaders and a referenceDate.toString()
-
Method Details
-
initialize
public static WorkingDaysToDaysReportConverter initialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator) throws InvalidArgumentException - Throws:
InvalidArgumentException
-
initialize
public static WorkingDaysToDaysReportConverter initialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator, Instant referenceDate) throws InvalidArgumentException Initializes the WorkingDaysToDaysConverter for a list of TimeIntervalColumnHeaders and a referenceDate. A new table is only created if there are bigger limits or the date has changed.- Parameters:
columnHeaders- a list of TimeIntervalColumnHeaders that determines the size of the tableworkingTimeCalculator- the workingTimeCalculator used by taskana to determine if a specific day is a working day.referenceDate- a Instant that represents the current day of the table- Returns:
- an instance of the WorkingDaysToDaysConverter
- Throws:
InvalidArgumentException- thrown if columnHeaders or referenceDate is null
-
convertDaysToWorkingDays
public int convertDaysToWorkingDays(int amountOfDays) -
convertWorkingDaysToDays
-
generateDaysToWorkingDays
-
toString
-