Record Class ChinaHolidayCalendar.CalendarRow
java.lang.Object
java.lang.Record
cloud.opencode.base.date.holiday.ChinaHolidayCalendar.CalendarRow
- Record Components:
date- the date — 日期 (null ifChinaHolidayCalendar.CalendarField.DATEnot selected)dayOfWeek- the day of week — 星期几 (null ifChinaHolidayCalendar.CalendarField.DAY_OF_WEEKnot selected)kind- the day kind — 日期类别 (null ifChinaHolidayCalendar.CalendarField.STATUSnot selected)reason- localized holiday name causing the rest or makeup — 引起休息/调休的假期本地化名称 (null ifChinaHolidayCalendar.CalendarField.REASONnot selected, or if no reason applies)
- Enclosing class:
ChinaHolidayCalendar
public static record ChinaHolidayCalendar.CalendarRow(LocalDate date, DayOfWeek dayOfWeek, ChinaHolidayCalendar.DayKind kind, String reason)
extends Record
One row of a calendar listing. Unselected fields are
null.
日历输出的一行。未选中的列为 null。
reason is the localized name of the holiday that triggered the
rest/makeup-workday. For normal workdays and normal weekends the field is
always null (i.e. no reason).
reason 为引起休息或调休的节假日本地化名称。对于正常工作日和正常周末,该字段始终为 null(无原因)。
- Since:
- JDK 25, opencode-base-date V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionCalendarRow(LocalDate date, DayOfWeek dayOfWeek, ChinaHolidayCalendar.DayKind kind, String reason) Creates an instance of aCalendarRowrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondate()Returns the value of thedaterecord component.Returns the value of thedayOfWeekrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanConvenience: whether this row represents a rest day (requiresChinaHolidayCalendar.CalendarField.STATUS).booleanConvenience: whether this row represents a workday (requiresChinaHolidayCalendar.CalendarField.STATUS).kind()Returns the value of thekindrecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CalendarRow
public CalendarRow(LocalDate date, DayOfWeek dayOfWeek, ChinaHolidayCalendar.DayKind kind, String reason) Creates an instance of aCalendarRowrecord class.
-
-
Method Details
-
isWorkday
public boolean isWorkday()Convenience: whether this row represents a workday (requiresChinaHolidayCalendar.CalendarField.STATUS). 便捷方法:判断该行是否为工作日(需选中ChinaHolidayCalendar.CalendarField.STATUS)。- Returns:
- true if workday | 工作日返回 true
- Throws:
IllegalStateException- if STATUS was not selected | STATUS 未选中时抛出
-
isRestDay
public boolean isRestDay()Convenience: whether this row represents a rest day (requiresChinaHolidayCalendar.CalendarField.STATUS). 便捷方法:判断该行是否为休息日(需选中ChinaHolidayCalendar.CalendarField.STATUS)。- Returns:
- true if rest day | 休息日返回 true
- Throws:
IllegalStateException- if STATUS was not selected | STATUS 未选中时抛出
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
date
-
dayOfWeek
-
kind
-
reason
-