クラス BusinessCalendar

java.lang.Object
one.cafebabe.businesscalendar4j.BusinessCalendar

public final class BusinessCalendar extends Object
Java class representing business calendar
  • フィールド詳細

    • UNITED_STATES

      public static final UnitedStates UNITED_STATES
      Predefined holidays in the United States
    • JAPAN

      public static final Japan JAPAN
      Predefined holidays in Japan
    • CLOSED_ON_SATURDAYS_AND_SUNDAYS

      public static final Function<LocalDate,String> CLOSED_ON_SATURDAYS_AND_SUNDAYS
      Fixed algorithm to close on Saturdays and Sundays
      導入されたバージョン:
      1.5
  • メソッドの詳細

    • newBuilder

      @NotNull public static @NotNull BusinessCalendarBuilder newBuilder()
      creates a new builder instance
      戻り値:
      builder
    • isHoliday

      public boolean isHoliday(@NotNull @NotNull LocalDate date)
      Test if the specified date is a holiday
      パラメータ:
      date - date
      戻り値:
      true if the specified date is a holiday
    • isHoliday

      public boolean isHoliday()
      Test if today is a holiday
      戻り値:
      true if the specified date is a holiday
      導入されたバージョン:
      1.3
    • isBusinessDay

      public boolean isBusinessDay(@NotNull @NotNull LocalDate date)
      Test if the specified date is a business day
      パラメータ:
      date - date
      戻り値:
      true if the specified date is a business day
    • isBusinessDay

      public boolean isBusinessDay()
      Test if today is a business day
      戻り値:
      true if the specified date is a business day
      導入されたバージョン:
      1.3
    • isBusinessHour

      public boolean isBusinessHour(@NotNull @NotNull LocalDateTime dateTime)
      Test if specified time is during business hours
      パラメータ:
      dateTime - time
      戻り値:
      true is specified time is during business hours
      導入されたバージョン:
      1.8
    • isBusinessHour

      public boolean isBusinessHour()
      Test if it's during business hours
      戻り値:
      true is it's during business hours
      導入されたバージョン:
      1.8
    • getBusinessHourSlots

      @NotNull public @NotNull List<BusinessHourSlot> getBusinessHourSlots(@NotNull @NotNull LocalDate date)
      Returns a list of BusinessHourSlot on a specific date
      パラメータ:
      date - date
      戻り値:
      list of business hour slots on a specified date, or an empty list if the specified date is a holiday
      導入されたバージョン:
      1.9
    • lastBusinessHourEnd

      @NotNull public @NotNull LocalDateTime lastBusinessHourEnd(@NotNull @NotNull LocalDateTime when)
      Returns when last business hours ended
      パラメータ:
      when - origin
      戻り値:
      the time when last business hours ended
      導入されたバージョン:
      1.8
    • nextBusinessHourEnd

      @NotNull public @NotNull LocalDateTime nextBusinessHourEnd(@NotNull @NotNull LocalDateTime when)
      Returns when next business hours end
      パラメータ:
      when - origin
      戻り値:
      the time when when next business hours end
      導入されたバージョン:
      1.8
    • lastBusinessHourStart

      @NotNull public @NotNull LocalDateTime lastBusinessHourStart(@NotNull @NotNull LocalDateTime when)
      Returns when last business hours started
      パラメータ:
      when - origin
      戻り値:
      the time when last business hours started
      導入されたバージョン:
      1.8
    • nextBusinessHourStart

      @NotNull public @NotNull LocalDateTime nextBusinessHourStart(@NotNull @NotNull LocalDateTime when)
      Returns when next business hours start
      パラメータ:
      when - origin
      戻り値:
      the time when when next business hours start
      導入されたバージョン:
      1.8
    • getHoliday

      @Nullable public @Nullable Holiday getHoliday(@NotNull @NotNull LocalDate date)
      Returns a Holiday on the specified date
      パラメータ:
      date - date
      戻り値:
      Holiday
    • lastBusinessDay

      @NotNull public @NotNull LocalDate lastBusinessDay(@NotNull @NotNull LocalDate date)
      Returns the last business day by a specific date
      パラメータ:
      date - specific date
      戻り値:
      last business day by the specified date
    • lastBusinessDay

      @NotNull public @NotNull LocalDate lastBusinessDay()
      Returns the last business day by today
      戻り値:
      last business day by the specified date
      導入されたバージョン:
      1.4
    • firstBusinessDay

      @NotNull public @NotNull LocalDate firstBusinessDay(@NotNull @NotNull LocalDate date)
      Returns the first business day on or after a specific date
      パラメータ:
      date - specific date
      戻り値:
      first business day on and after the specified date
    • firstBusinessDay

      @NotNull public @NotNull LocalDate firstBusinessDay()
      Returns the first business day after today
      戻り値:
      first business day after today
      導入されたバージョン:
      1.4
    • lastHoliday

      @NotNull public @NotNull Holiday lastHoliday(@NotNull @NotNull LocalDate date)
      Returns the last holiday by a specific date
      パラメータ:
      date - specific date
      戻り値:
      last holiday by the specified date
    • lastHoliday

      @NotNull public @NotNull Holiday lastHoliday()
      Returns the last holiday by today
      戻り値:
      last holiday by today
      導入されたバージョン:
      1.4
    • firstHoliday

      @NotNull public @NotNull Holiday firstHoliday(@NotNull @NotNull LocalDate date)
      Returns the first holiday on or after a specific date
      パラメータ:
      date - specific date
      戻り値:
      first holiday on or after the specified date
    • firstHoliday

      @NotNull public @NotNull Holiday firstHoliday()
      Returns the first holiday after today
      戻り値:
      first holiday on or after the specified date
    • getHolidaysBetween

      @NotNull public @NotNull List<Holiday> getHolidaysBetween(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to)
      Returns holidays between specified period
      パラメータ:
      from - from date (inclusive)
      to - to date (inclusive)
      戻り値:
      List of holidays between the specified period
    • getBusinessDaysBetween

      @NotNull public @NotNull List<LocalDate> getBusinessDaysBetween(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to)
      Returns business days between specified period
      パラメータ:
      from - from date (inclusive)
      to - to date (inclusive)
      戻り値:
      List of business days between the specified period
      導入されたバージョン:
      1.15
    • dump

      public String dump(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to)
      Dump holidays and business days in the specified period
      パラメータ:
      from - from date (inclusive)
      to - to date (inclusive)
      戻り値:
      dumped information about holidays and business days in the specified period
      導入されたバージョン:
      1.15
    • dump

      public String dump(@NotNull @NotNull LocalDate from, @NotNull @NotNull LocalDate to, String dateFormat)
      Dump holidays and business days in the specified period
      パラメータ:
      from - from date (inclusive)
      to - to date (inclusive)
      dateFormat - date format pattern
      戻り値:
      dumped information about holidays and business days in the specified period
      導入されたバージョン:
      1.15