Record Class CalendarDay
java.lang.Object
java.lang.Record
io.leandev.appfuse.almanac.calendar.CalendarDay
- Record Components:
date- 日期holiday- 是否為假日(true 表示放假、非辦公日)description- 說明(如節日名稱;平日可能為 null)
- All Implemented Interfaces:
Serializable
public record CalendarDay(LocalDate date, boolean holiday, String description)
extends Record
implements Serializable
行政機關辦公日曆中的一天
對應 almanac GET /api/v1/calendar/{year} 回應的元素。
- Since:
- 4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCalendarDay(LocalDate date, boolean holiday, String description) Creates an instance of aCalendarDayrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondate()Returns the value of thedaterecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanholiday()Returns the value of theholidayrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CalendarDay
Creates an instance of aCalendarDayrecord class.- Parameters:
date- the value for thedaterecord componentholiday- the value for theholidayrecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
date
-
holiday
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-