BusinessCalendar
Keywords: net.corda.finance.contracts.BusinessCalendar class
Date: 2023-09-18

net.corda.finance.contracts

## Class BusinessCalendar

- net.corda.finance.contracts.BusinessCalendar

-     public class BusinessCalendar

  A business calendar performs date calculations that take into account national holidays and weekends. This is a typical feature of financial contracts, in which a business may not want a payment event to fall on a day when no staff are around to handle problems.

- - ### Field Detail

    - #### EMPTY

          @JvmField
           @NotNull
          public static BusinessCalendar EMPTY

    - #### Companion

          public static net.corda.finance.contracts.BusinessCalendar.Companion Companion

  - ### Constructor Detail

    - #### BusinessCalendar

          public BusinessCalendar(@NotNull
                                  java.util.SortedSet<java.time.LocalDate> holidayDates)

      A business calendar performs date calculations that take into account national holidays and weekends. This is a typical feature of financial contracts, in which a business may not want a payment event to fall on a day when no staff are around to handle problems.

  - ### Method Detail

    - #### plus

          @NotNull
          public BusinessCalendar plus(@NotNull
                                                BusinessCalendar other)

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object other)

    - #### hashCode

          public int hashCode()

    - #### isWorkingDay

          public boolean isWorkingDay(@NotNull
                                      java.time.LocalDate date)

    - #### applyRollConvention

          @NotNull
          public java.time.LocalDate applyRollConvention(@NotNull
                                                                  java.time.LocalDate testDate,
                                                                  @NotNull
                                                                  DateRollConvention dateRollConvention)

    - #### moveBusinessDays

          @NotNull
          public java.time.LocalDate moveBusinessDays(@NotNull
                                                               java.time.LocalDate date,
                                                               @NotNull
                                                               DateRollDirection direction,
                                                               int i)

      Returns a date which is the inbound date plus/minus a given number of business days. TODO: Make more efficient if necessary

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### getHolidayDates

          @NotNull
          public java.util.SortedSet<java.time.LocalDate> getHolidayDates()

    - #### calculateDaysBetween

          @JvmStatic
          public static int calculateDaysBetween(@NotNull
                                                            java.time.LocalDate startDate,
                                                            @NotNull
                                                            java.time.LocalDate endDate,
                                                            @NotNull
                                                            DayCountBasisYear dcbYear,
                                                            @NotNull
                                                            DayCountBasisDay dcbDay)

    - #### parseDateFromString

          @JvmStatic
           @NotNull
          public static java.time.LocalDate parseDateFromString(@NotNull
                                                                                     java.lang.String it)

      Parses a date of the form YYYY-MM-DD, like 2016-01-10 for 10th Jan.

    - #### createGenericSchedule

          @JvmStatic
           @NotNull
          public static java.util.List<java.time.LocalDate> createGenericSchedule(@NotNull
                                                                                                       java.time.LocalDate startDate,
                                                                                                       @NotNull
                                                                                                       Frequency period,
                                                                                                       @NotNull
                                                                                                       BusinessCalendar calendar,
                                                                                                       @NotNull
                                                                                                       DateRollConvention dateRollConvention,
                                                                                                       int noOfAdditionalPeriods,
                                                                                                       @Nullable
                                                                                                       java.time.LocalDate endDate,
                                                                                                       @Nullable
                                                                                                       java.lang.Integer periodOffset)

      Calculates an event schedule that moves events around to ensure they fall on working days.

    - #### getOffsetDate

          @JvmStatic
           @NotNull
          public static java.time.LocalDate getOffsetDate(@NotNull
                                                                               java.time.LocalDate startDate,
                                                                               @NotNull
                                                                               Frequency period,
                                                                               int steps)

      Calculates the date from @startDate moving forward 'steps' of time size 'period'. Does not apply calendar logic / roll conventions.