Record Class ChinaHolidayCalendar.DayInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.date.holiday.ChinaHolidayCalendar.DayInfo
- Record Components:
date- the date | 日期kind- the day kind | 日期类别holidayName- the holiday English name (null if not a holiday or makeup) | 假期英文名(普通工作日/周末为 null)chineseName- the holiday Chinese name (null if not a holiday or makeup) | 假期中文名(普通工作日/周末为 null)
- Enclosing class:
ChinaHolidayCalendar
public static record ChinaHolidayCalendar.DayInfo(LocalDate date, ChinaHolidayCalendar.DayKind kind, String holidayName, String chineseName)
extends Record
Per-day classification under State-Council holiday rules.
国务院假期规则下单日的分类信息。
- Since:
- JDK 25, opencode-base-date V1.0.4
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionDayInfo(LocalDate date, ChinaHolidayCalendar.DayKind kind, String holidayName, String chineseName) Creates an instance of aDayInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thechineseNamerecord component.date()Returns the value of thedaterecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theholidayNamerecord component.booleanWhether this day is a rest day.booleanWhether this day is a workday.kind()Returns the value of thekindrecord component.Localized reason: Chinese name of the holiday/makeup that triggered this day, falling back to EnglishholidayName()ifchineseName()is null.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DayInfo
public DayInfo(LocalDate date, ChinaHolidayCalendar.DayKind kind, String holidayName, String chineseName) Creates an instance of aDayInforecord class.- Parameters:
date- the value for thedaterecord componentkind- the value for thekindrecord componentholidayName- the value for theholidayNamerecord componentchineseName- the value for thechineseNamerecord component
-
-
Method Details
-
isWorkday
public boolean isWorkday()Whether this day is a workday. 是否为工作日。- Returns:
- true if workday | 工作日返回 true
-
isRestDay
public boolean isRestDay()Whether this day is a rest day. 是否为休息日。- Returns:
- true if rest day | 休息日返回 true
-
localizedReason
Localized reason: Chinese name of the holiday/makeup that triggered this day, falling back to EnglishholidayName()ifchineseName()is null. Returnsnullfor normal workdays and weekends. 本地化原因:触发该日的节假日中文名(chineseName()为 null 时回退英文名); 普通工作日和周末返回 null。- Returns:
- localized reason or null | 本地化原因或 null
-
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
-
kind
-
holidayName
Returns the value of theholidayNamerecord component.- Returns:
- the value of the
holidayNamerecord component
-
chineseName
Returns the value of thechineseNamerecord component.- Returns:
- the value of the
chineseNamerecord component
-