Class CalendarMonthlyBucketService
java.lang.Object
overit.geocallapp.wfm.roughplanning.bl.bucket.BucketService
overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarBucketService
overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarMonthlyBucketService
The CalendarMonthlyBucketService is the implementation of
CalendarBucketService
using a calendar month duration as a time unit.
Starting from starDate param, it generates a bucket that begins at the first of the month
(that is greater or equal then the startDate) and is large a number of calendar months
specified in the timeSize property (mind that, the end of the bucket must be less or equal than the endDate param).
At the end the total number of buckets created is totalBuckets = calendarMonthsBetweenParamDates / timeSize
Example:
startDate = 15/01/2024
endDate = 07/06/2024
calendarMonthsBetweenParamDates = 4
timeSize = 2
totalBuckets = 4 / 2 = 2 buckets (bucket1 from 01/02/2024 to 31/03/2024) (bucket2 from 01/04/2024 to 31/05/2024)- Since:
- 18.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCalendarMonthlyBucketService(Long roughPlanning, TimeUnit timeUnit, Long timeSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanBucketBeCreated(Date startBucketDate, Date endDate) It establishes whether a bucket can be createdprotected DategetEndBucketDate(Date startBucketDate) Returns an end date for the bucket creationprotected DategetInitialStartBucketDate(Date startDate) Returns an initial date for the bucket creationMethods inherited from class overit.geocallapp.wfm.roughplanning.bl.bucket.CalendarBucketService
createBucketsMethods inherited from class overit.geocallapp.wfm.roughplanning.bl.bucket.BucketService
getRoughPlanning, getTimeSize, getTimeUnit
-
Constructor Details
-
CalendarMonthlyBucketService
-
-
Method Details
-
canBucketBeCreated
Description copied from class:CalendarBucketServiceIt establishes whether a bucket can be created- Specified by:
canBucketBeCreatedin classCalendarBucketService- Parameters:
startBucketDate- starting bucket dateendDate- upper limit end date to establish that a bucket can be created- Returns:
- a boolean
-
getEndBucketDate
Description copied from class:CalendarBucketServiceReturns an end date for the bucket creation- Specified by:
getEndBucketDatein classCalendarBucketService- Parameters:
startBucketDate- starting bucket date- Returns:
- a date
-
getInitialStartBucketDate
Description copied from class:CalendarBucketServiceReturns an initial date for the bucket creation- Specified by:
getInitialStartBucketDatein classCalendarBucketService- Parameters:
startDate- the lower limit for buckets creation- Returns:
- a date
-