Record Class DayStatus
java.lang.Object
java.lang.Record
io.leandev.appfuse.calendar.DayStatus
- Record Components:
date- 日期selectable- 是否可選reasonCode- 不可選的結構化原因代碼(可選時為 null);常用代碼見ReasonCodes,應用可擴充自訂字串description- 補充說明(如節日名稱;透傳自資料來源,可能為 null)
- All Implemented Interfaces:
Serializable
public record DayStatus(LocalDate date, boolean selectable, String reasonCode, String description)
extends Record
implements Serializable
營業行事曆中一天的可選性狀態
BusinessCalendar 的跨端契約(ADR-012):resolve() 解算結果的元素,序列化後
即為供前端日期元件消費的 wire format。前端以 reasonCode 經 i18n 呈現不可選原因,
不在後端組本地化文字。
- Since:
- 4.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DayStatus建立不可選日date()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.Returns the value of thereasonCoderecord component.booleanReturns the value of theselectablerecord component.static DayStatusselectable(LocalDate date) 建立可選日static DayStatusselectable(LocalDate date, String description) 建立可選日(帶補充說明)final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DayStatus
Creates an instance of aDayStatusrecord class.- Parameters:
date- the value for thedaterecord componentselectable- the value for theselectablerecord componentreasonCode- the value for thereasonCoderecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
selectable
-
selectable
-
closed
建立不可選日- Parameters:
date- 日期reasonCode- 結構化原因代碼(見ReasonCodes)description- 補充說明(可為 null)- Returns:
- 不可選的 DayStatus
-
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
-
selectable
public boolean selectable()Returns the value of theselectablerecord component.- Returns:
- the value of the
selectablerecord component
-
reasonCode
Returns the value of thereasonCoderecord component.- Returns:
- the value of the
reasonCoderecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-