Package org.daiitech.naftah.builtin.time
Record Class NaftahDate.Calendar
java.lang.Object
java.lang.Record
org.daiitech.naftah.builtin.time.NaftahDate.Calendar
- Record Components:
calendar- the name of the calendarchronology- the associatedChronology
- Enclosing class:
- NaftahDate
Represents an Naftah calendar specification.
If no chronology or calendar name is provided, default values are applied automatically.
This component is optional and may be omitted in date expressions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for thecalendarrecord component.private final ChronologyThe field for thechronologyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCalendar(String calendar, Chronology chronology) Creates an instance of aCalendarrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncalendar()Returns the value of thecalendarrecord component.Returns the value of thechronologyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static NaftahDate.Calendarof(String calendar, Chronology chronology) Creates aCalendarinstance using the given name and chronology.static NaftahDate.Calendarof(Chronology chronology) Creates aCalendarinstance using only a chronology.toString()Returns a string representation of thisNaftahDate.Calendarin the format: "Calendar: calendar".
-
Field Details
-
calendar
The field for thecalendarrecord component. -
chronology
The field for thechronologyrecord component.
-
-
Constructor Details
-
Calendar
Creates an instance of aCalendarrecord class.- Parameters:
calendar- the value for thecalendarrecord componentchronology- the value for thechronologyrecord component
-
-
Method Details
-
of
Creates aCalendarinstance using the given name and chronology.- Parameters:
calendar- the calendar namechronology- the associated chronology- Returns:
- a new
Calendarinstance
-
of
Creates aCalendarinstance using only a chronology. The calendar name will default automatically.- Parameters:
chronology- the associated chronology- Returns:
- a new
Calendarinstance
-
toString
Returns a string representation of thisNaftahDate.Calendarin the format: "Calendar: calendar".Displays the name of the calendar. If no name was provided, the default calendar name is used.
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
calendar
Returns the value of thecalendarrecord component.- Returns:
- the value of the
calendarrecord component
-
chronology
Returns the value of thechronologyrecord component.- Returns:
- the value of the
chronologyrecord component
-