Class WorkingDaysToDaysReportConverter
- java.lang.Object
-
- pro.taskana.monitor.internal.preprocessor.WorkingDaysToDaysReportConverter
-
public class WorkingDaysToDaysReportConverter extends Object
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intconvertDaysToWorkingDays(int amountOfDays)List<Integer>convertWorkingDaysToDays(int amountOfWorkdays)protected Map<Integer,Integer>generateDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate)static WorkingDaysToDaysReportConverterinitialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator)static WorkingDaysToDaysReportConverterinitialize(List<? extends TimeIntervalColumnHeader> columnHeaders, WorkingTimeCalculator workingTimeCalculator, Instant referenceDate)Initializes the WorkingDaysToDaysConverter for a list of TimeIntervalColumnHeaders and a referenceDate.StringtoString()
-
-
-
Method Detail
-
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)
-
generateDaysToWorkingDays
protected Map<Integer,Integer> generateDaysToWorkingDays(List<? extends TimeIntervalColumnHeader> columnHeaders, Instant referenceDate)
-
-