Class CalendarDailyBucketService


public class CalendarDailyBucketService extends CalendarBucketService
The CalendarDailyBucketService is the implementation of CalendarBucketService using a calendar day duration as a time unit. Starting from starDate param, it generates a bucket that begins on the same date and is large a number of calendar days 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 = calendarDaysBetweenParamDates / timeSize Example: startDate = 15/01/2024 endDate = 21/01/2024 calendarDaysBetweenParamDates = 7 timeSize = 2 totalBuckets = 7 / 2 = 3 buckets (bucket1 from 15/01/2024 to 16/01/2024) (bucket2 from 17/01/2024 to 18/01/2024) (bucket10 from 19/01/2024 to 20/01/2024)
Since:
19.0
  • Constructor Details

    • CalendarDailyBucketService

      protected CalendarDailyBucketService(Long roughPlanning, TimeUnit timeUnit, Long timeSize)
  • Method Details

    • canBucketBeCreated

      protected boolean canBucketBeCreated(Date startBucketDate, Date endDate)
      Description copied from class: CalendarBucketService
      It establishes whether a bucket can be created
      Specified by:
      canBucketBeCreated in class CalendarBucketService
      Parameters:
      startBucketDate - starting bucket date
      endDate - upper limit end date to establish that a bucket can be created
      Returns:
      a boolean
    • getEndBucketDate

      protected Date getEndBucketDate(Date startBucketDate)
      Description copied from class: CalendarBucketService
      Returns an end date for the bucket creation
      Specified by:
      getEndBucketDate in class CalendarBucketService
      Parameters:
      startBucketDate - starting bucket date
      Returns:
      a date
    • getInitialStartBucketDate

      protected Date getInitialStartBucketDate(Date startDate)
      Description copied from class: CalendarBucketService
      Returns an initial date for the bucket creation
      Specified by:
      getInitialStartBucketDate in class CalendarBucketService
      Parameters:
      startDate - the lower limit for buckets creation
      Returns:
      a date