Record Class NaftahDateTime

java.lang.Object
java.lang.Record
org.daiitech.naftah.builtin.time.NaftahDateTime
Record Components:
naftahDate - the date component
naftahTime - the time component
temporal - the resolved temporal
All Implemented Interfaces:
DateSupport, NaftahTemporal, NaftahTemporalPoint, TimeSupport

public record NaftahDateTime(NaftahDate naftahDate, NaftahTime naftahTime, Temporal temporal) extends Record implements NaftahTemporalPoint, DateSupport, TimeSupport
Represents a complete Arabic date-time, consisting of:

This record is typically produced after parsing Arabic date and time expressions and resolving them against a specific chronology or calendar system.

The Temporal allows integration with Java's time API.

Author:
Chakib Daii
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final NaftahDate
    The field for the naftahDate record component.
    private final NaftahTime
    The field for the naftahTime record component.
    private final Temporal
    The field for the temporal record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    NaftahDateTime(NaftahDate naftahDate, NaftahTime naftahTime, Temporal temporal)
    Creates an instance of a NaftahDateTime record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    compute(NaftahTemporalAmount arabicTemporalAmount, boolean plus)
    Computes a new ArabicDateTime by applying the given Arabic temporal amount using either addition or subtraction.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the day-of-month of the date part of this ArabicDateTime.
    Returns the day of the week of the date part of this ArabicDateTime as an Arabic string.
    int
    Returns the day-of-year of the date part of this ArabicDateTime, according to its chronology.
    int
    Gets the hour-of-day from the time part of this ArabicDateTime.
    int
    Gets the minute-of-hour from the time part of this ArabicDateTime.
    Returns the Arabic month name of the date part of this ArabicDateTime.
    int
    Returns the numeric month value (1–12) of the date part of this ArabicDateTime.
    int
    Gets the nano-of-second from the time part of this ArabicDateTime.
    int
    Gets the second-of-minute from the time part of this ArabicDateTime.
    int
    Returns the year of the date part of this ArabicDateTime.
    final int
    Returns a hash code value for this object.
    boolean
    Checks whether the year of the date part of this ArabicDateTime is a leap year in its chronology.
    int
    Returns the length of the month in days for the date part of this ArabicDateTime.
    int
    Returns the length of the year in days for the date part of this ArabicDateTime.
    minus(NaftahTemporalAmount naftahTemporalAmount)
    Returns a new ArabicDateTime obtained by subtracting the given Arabic temporal amount from this date-time.
    minusDays(long daysToSubtract)
    Returns a new ArabicDateTime with the specified number of days subtracted.
    minusHours(long hoursToSubtract)
    Returns a new ArabicDateTime with the specified number of hours subtracted.
    minusMinutes(long minutesToSubtract)
    Returns a new ArabicDateTime with the specified number of minutes subtracted.
    minusMonths(long monthsToSubtract)
    Returns a new ArabicDateTime with the specified number of months subtracted.
    minusNanos(long nanosToSubtract)
    Returns a new ArabicDateTime with the specified number of nanoseconds subtracted.
    minusSeconds(long secondsToSubtract)
    Returns a new ArabicDateTime with the specified number of seconds subtracted.
    minusWeeks(long weeksToSubtract)
    Returns a new ArabicDateTime with the specified number of weeks subtracted.
    minusYears(long yearsToSubtract)
    Returns a new ArabicDateTime with the specified number of years subtracted.
    Returns the value of the naftahDate record component.
    Returns the value of the naftahTime record component.
    now()
    Obtains the current date-time using the default chronology and the system default time zone.
    now(Chronology chronology)
    Obtains the current date-time using the specified chronology and the system default time zone.
    now(Chronology chronology, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains the current date-time using the specified chronology and zone or offset.
    Obtains the current date-time using the specified calendar and the system default time zone.
    Obtains the current date-time using the specified calendar and zone or offset.
    Obtains the current date-time using the default chronology and the specified zone or offset.
    of(int year, int month, int dayOfMonth, int hour, int minute)
    Obtains an instance of ArabicDateTime from year, month, day, hour, and minute.
    of(int year, int month, int dayOfMonth, int hour, int minute, int second)
    Obtains an instance of ArabicDateTime from year, month, day, hour, minute, and second.
    of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
    Obtains an instance of ArabicDateTime from year, month, day, hour, minute, second, and nanosecond.
    of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.
    of(int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from year, month, day, hour, minute, and second, using an optional time zone or offset.
    of(int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from year, month, day, hour, and minute, using an optional time zone or offset.
    of(int year, String arabicMonth, int day, int hour, int minute)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, and minute.
    of(int year, String arabicMonth, int day, int hour, int minute, int second)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, and second.
    of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, second, and nanosecond.
    of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.
    of(int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.
    of(int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, and minute, using an optional time zone or offset.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, and minute.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, and second.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, second, and nanosecond.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, and second, using an optional time zone or offset.
    of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, and minute, using an optional time zone or offset.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, and minute.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, and second.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, second, and nanosecond.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.
    of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
    Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, and minute, using an optional time zone or offset.
    of(NaftahDate naftahDate, NaftahTime arabicTime)
    Creates a new ArabicDateTime instance.
    of(NaftahDate naftahDate, NaftahTime arabicTime, Temporal temporal)
    Creates a new ArabicDateTime instance.
    plus(NaftahTemporalAmount naftahTemporalAmount)
    Returns a new ArabicDateTime obtained by adding the given Arabic temporal amount to this date-time.
    plusDays(long daysToAdd)
    Returns a new ArabicDateTime with the specified number of days added.
    plusHours(long hoursToAdd)
    Returns a new ArabicDateTime with the specified number of hours added.
    plusMinutes(long minutesToAdd)
    Returns a new ArabicDateTime with the specified number of minutes added.
    plusMonths(long monthsToAdd)
    Returns a new ArabicDateTime with the specified number of months added.
    plusNanos(long nanosToAdd)
    Returns a new ArabicDateTime with the specified number of nanoseconds added.
    plusSeconds(long secondsToAdd)
    Returns a new ArabicDateTime with the specified number of seconds added.
    plusWeeks(long weeksToAdd)
    Returns a new ArabicDateTime with the specified number of weeks added.
    plusYears(long yearsToAdd)
    Returns a new ArabicDateTime with the specified number of years added.
    Returns the value of the temporal record component.
    long
    Returns the number of days since the epoch (1970-01-01 ISO) for the date part of this ArabicDateTime.
    Returns a string representation of this ArabicDateTime in the format: "date time".

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.daiitech.naftah.builtin.time.NaftahTemporalPoint

    greaterThan, greaterThanEquals, isEquals, lessThan, lessThanEquals, notEquals

    Methods inherited from interface org.daiitech.naftah.builtin.time.TimeSupport

    getMilli
  • Field Details

    • naftahDate

      private final NaftahDate naftahDate
      The field for the naftahDate record component.
    • naftahTime

      private final NaftahTime naftahTime
      The field for the naftahTime record component.
    • temporal

      private final Temporal temporal
      The field for the temporal record component.
  • Constructor Details

    • NaftahDateTime

      public NaftahDateTime(NaftahDate naftahDate, NaftahTime naftahTime, Temporal temporal)
      Creates an instance of a NaftahDateTime record class.
      Parameters:
      naftahDate - the value for the naftahDate record component
      naftahTime - the value for the naftahTime record component
      temporal - the value for the temporal record component
  • Method Details

    • now

      public static NaftahDateTime now()
      Obtains the current date-time using the default chronology and the system default time zone.
      Returns:
      the current ArabicDateTime
    • now

      public static NaftahDateTime now(Chronology chronology)
      Obtains the current date-time using the specified chronology and the system default time zone.
      Parameters:
      chronology - the chronology to use (not null)
      Returns:
      the current ArabicDateTime
      Throws:
      NullPointerException - if chronology is null
    • now

      public static NaftahDateTime now(NaftahDate.Calendar calendar)
      Obtains the current date-time using the specified calendar and the system default time zone.
      Parameters:
      calendar - the calendar to use (not null)
      Returns:
      the current ArabicDateTime
      Throws:
      NullPointerException - if calendar is null
    • now

      public static NaftahDateTime now(NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains the current date-time using the default chronology and the specified zone or offset.
      Parameters:
      zoneOrOffset - the zone or offset to use, or null to use the system default
      Returns:
      the current ArabicDateTime
    • now

      public static NaftahDateTime now(Chronology chronology, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains the current date-time using the specified chronology and zone or offset.
      Parameters:
      chronology - the chronology to use (not null)
      zoneOrOffset - the zone or offset to use, or null to use the system default
      Returns:
      the current ArabicDateTime
      Throws:
      NullPointerException - if chronology is null
    • now

      public static NaftahDateTime now(NaftahDate.Calendar calendar, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains the current date-time using the specified calendar and zone or offset.

      The returned ArabicDateTime represents the current date and time as resolved by the given calendar and zone or offset.

      Parameters:
      calendar - the calendar to use (not null)
      zoneOrOffset - the zone or offset to use, or null to use the system default
      Returns:
      the current ArabicDateTime
      Throws:
      NullPointerException - if calendar is null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute)
      Obtains an instance of ArabicDateTime from year, month, day, hour, and minute.

      The second and nanosecond fields will default to 0. The day must be valid for the specified month and year.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from year, month, day, hour, and minute, using an optional time zone or offset.

      The second and nanosecond fields will default to 0. The day must be valid for the specified month and year.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second)
      Obtains an instance of ArabicDateTime from year, month, day, hour, minute, and second.

      The nanosecond field will default to 0. The day must be valid for the specified month and year.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from year, month, day, hour, minute, and second, using an optional time zone or offset.

      The nanosecond field will default to 0. The day must be valid for the specified month and year.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
      Obtains an instance of ArabicDateTime from year, month, day, hour, minute, second, and nanosecond.

      The day must be valid for the specified month and year.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.

      The day must be valid for the specified month and year.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, and minute.

      The second and nanosecond fields will default to 0.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, and minute, using an optional time zone or offset.

      The second and nanosecond fields will default to 0. The day must be valid for the specified month and year according to the provided chronology.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, and second.

      The nanosecond field will default to 0.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, and second, using an optional time zone or offset.

      The nanosecond field will default to 0. The day must be valid for the specified month and year according to the provided chronology.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, second, and nanosecond.
      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, year, month, day, hour, minute, second, and nanosecond, using an optional time zone or offset.

      The day must be valid for the specified month and year according to the provided chronology.

      If a zoneOrOffset is provided, the resulting date-time will be backed by a OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      month - the month-of-year value (1–12)
      dayOfMonth - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, and minute.

      Seconds and nanoseconds default to 0.

      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month value (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, and minute, using an optional time zone or offset.

      The second and nanosecond fields default to 0. The day must be valid for the specified month and year.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, and second.

      Nanoseconds default to 0. The day must be valid for the specified month and year.

      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.

      The nanosecond field defaults to 0. The day must be valid for the specified month and year.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, second, and nanosecond.
      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.

      The day must be valid for the specified month and year.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, and minute.

      Seconds and nanoseconds default to 0.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, and minute, using an optional time zone or offset.

      Seconds and nanoseconds default to 0.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, and second.

      Nanoseconds default to 0.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, and second, using an optional time zone or offset.

      Nanoseconds default to 0.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, second, and nanosecond.
      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nano-of-second (0–999,999,999)
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(Chronology chronology, int year, String arabicMonth, int day, int hour, int minute, int second, int nanoOfSecond, NaftahTime.ZoneOrOffset zoneOrOffset)
      Obtains an instance of ArabicDateTime from a specific Chronology, day, Arabic month name, year, hour, minute, second, and nanosecond, using an optional time zone or offset.

      This method allows full specification of the time down to nanoseconds.

      If zoneOrOffset is provided, the resulting date-time will be backed by an OffsetDateTime or ZonedDateTime. If null, the result is backed by a LocalDateTime.

      Parameters:
      chronology - the chronology to use, not null
      year - the year value
      arabicMonth - the Arabic month name, not null
      day - the day-of-month (1–31)
      hour - the hour-of-day (0–23)
      minute - the minute-of-hour (0–59)
      second - the second-of-minute (0–59)
      nanoOfSecond - the nanosecond-of-second (0–999,999,999)
      zoneOrOffset - the optional time zone or offset, may be null
      Returns:
      a new ArabicDateTime instance, not null
    • of

      public static NaftahDateTime of(NaftahDate naftahDate, NaftahTime arabicTime)
      Creates a new ArabicDateTime instance.
      Parameters:
      naftahDate - the date component
      arabicTime - the time component
      Returns:
      a new ArabicDateTime instance
    • of

      public static NaftahDateTime of(NaftahDate naftahDate, NaftahTime arabicTime, Temporal temporal)
      Creates a new ArabicDateTime instance.
      Parameters:
      naftahDate - the date component
      arabicTime - the time component
      temporal - the resolved temporal
      Returns:
      a new ArabicDateTime instance
    • toEpochDay

      public long toEpochDay()
      Returns the number of days since the epoch (1970-01-01 ISO) for the date part of this ArabicDateTime.
      Specified by:
      toEpochDay in interface DateSupport
      Returns:
      the epoch day count
    • getYear

      public int getYear()
      Returns the year of the date part of this ArabicDateTime.
      Specified by:
      getYear in interface DateSupport
      Returns:
      the year value
    • getMonthValue

      public int getMonthValue()
      Returns the numeric month value (1–12) of the date part of this ArabicDateTime.
      Specified by:
      getMonthValue in interface DateSupport
      Returns:
      the month value
    • getMonth

      public String getMonth()
      Returns the Arabic month name of the date part of this ArabicDateTime.
      Specified by:
      getMonth in interface DateSupport
      Returns:
      the Arabic month name
    • getDayOfMonth

      public int getDayOfMonth()
      Returns the day-of-month of the date part of this ArabicDateTime.
      Specified by:
      getDayOfMonth in interface DateSupport
      Returns:
      the day of the month
    • getDayOfYear

      public int getDayOfYear()
      Returns the day-of-year of the date part of this ArabicDateTime, according to its chronology.
      Specified by:
      getDayOfYear in interface DateSupport
      Returns:
      the day of the year (1–365 or 1–366 for leap years)
    • getDayOfWeek

      public String getDayOfWeek()
      Returns the day of the week of the date part of this ArabicDateTime as an Arabic string.
      Specified by:
      getDayOfWeek in interface DateSupport
      Returns:
      the Arabic day of the week
    • isLeapYear

      public boolean isLeapYear()
      Checks whether the year of the date part of this ArabicDateTime is a leap year in its chronology.
      Specified by:
      isLeapYear in interface DateSupport
      Returns:
      true if it is a leap year, false otherwise
    • lengthOfMonth

      public int lengthOfMonth()
      Returns the length of the month in days for the date part of this ArabicDateTime.
      Specified by:
      lengthOfMonth in interface DateSupport
      Returns:
      the number of days in the month
    • getHour

      public int getHour()
      Gets the hour-of-day from the time part of this ArabicDateTime.

      The value is based on a 24-hour clock.

      Specified by:
      getHour in interface TimeSupport
      Returns:
      the hour-of-day, from 0 to 23
    • getMinute

      public int getMinute()
      Gets the minute-of-hour from the time part of this ArabicDateTime.
      Specified by:
      getMinute in interface TimeSupport
      Returns:
      the minute-of-hour, from 0 to 59
    • getSecond

      public int getSecond()
      Gets the second-of-minute from the time part of this ArabicDateTime.
      Specified by:
      getSecond in interface TimeSupport
      Returns:
      the second-of-minute, from 0 to 59
    • getNano

      public int getNano()
      Gets the nano-of-second from the time part of this ArabicDateTime.
      Specified by:
      getNano in interface TimeSupport
      Returns:
      the nano-of-second, from 0 to 999,999,999
    • lengthOfYear

      public int lengthOfYear()
      Returns the length of the year in days for the date part of this ArabicDateTime.

      The number of days depends on the chronology of the date:

      • For Gregorian/ISO years, leap years return 366 days, non-leap years return 365 days.
      • For Hijri years, leap years return 355 days, non-leap years return 354 days.
      Specified by:
      lengthOfYear in interface DateSupport
      Returns:
      the number of days in the year
    • plus

      public NaftahDateTime plus(NaftahTemporalAmount naftahTemporalAmount)
      Returns a new ArabicDateTime obtained by adding the given Arabic temporal amount to this date-time.
      Specified by:
      plus in interface NaftahTemporalPoint
      Parameters:
      naftahTemporalAmount - the temporal amount to add
      Returns:
      a new ArabicDateTime instance
    • plusYears

      public NaftahDateTime plusYears(long yearsToAdd)
      Returns a new ArabicDateTime with the specified number of years added.
      Specified by:
      plusYears in interface DateSupport
      Parameters:
      yearsToAdd - the number of years to add, may be negative
      Returns:
      a new ArabicDateTime with the years added
    • plusMonths

      public NaftahDateTime plusMonths(long monthsToAdd)
      Returns a new ArabicDateTime with the specified number of months added.
      Specified by:
      plusMonths in interface DateSupport
      Parameters:
      monthsToAdd - the number of months to add, may be negative
      Returns:
      a new ArabicDateTime with the months added
    • plusWeeks

      public NaftahDateTime plusWeeks(long weeksToAdd)
      Returns a new ArabicDateTime with the specified number of weeks added.
      Specified by:
      plusWeeks in interface DateSupport
      Parameters:
      weeksToAdd - the number of weeks to add, may be negative
      Returns:
      a new ArabicDateTime with the weeks added
    • plusDays

      public NaftahDateTime plusDays(long daysToAdd)
      Returns a new ArabicDateTime with the specified number of days added.
      Specified by:
      plusDays in interface DateSupport
      Parameters:
      daysToAdd - the number of days to add, may be negative
      Returns:
      a new ArabicDateTime with the days added
    • plusHours

      public NaftahDateTime plusHours(long hoursToAdd)
      Returns a new ArabicDateTime with the specified number of hours added.
      Specified by:
      plusHours in interface TimeSupport
      Parameters:
      hoursToAdd - the number of hours to add, may be negative
      Returns:
      a new ArabicDateTime with the hours added
    • plusMinutes

      public NaftahDateTime plusMinutes(long minutesToAdd)
      Returns a new ArabicDateTime with the specified number of minutes added.
      Specified by:
      plusMinutes in interface TimeSupport
      Parameters:
      minutesToAdd - the number of minutes to add, may be negative
      Returns:
      a new ArabicDateTime with the minutes added
    • plusSeconds

      public NaftahDateTime plusSeconds(long secondsToAdd)
      Returns a new ArabicDateTime with the specified number of seconds added.
      Specified by:
      plusSeconds in interface TimeSupport
      Parameters:
      secondsToAdd - the number of seconds to add, may be negative
      Returns:
      a new ArabicDateTime with the seconds added
    • plusNanos

      public NaftahDateTime plusNanos(long nanosToAdd)
      Returns a new ArabicDateTime with the specified number of nanoseconds added.
      Specified by:
      plusNanos in interface TimeSupport
      Parameters:
      nanosToAdd - the number of nanoseconds to add, may be negative
      Returns:
      a new ArabicDateTime with the nanoseconds added
    • minus

      public NaftahDateTime minus(NaftahTemporalAmount naftahTemporalAmount)
      Returns a new ArabicDateTime obtained by subtracting the given Arabic temporal amount from this date-time.
      Specified by:
      minus in interface NaftahTemporalPoint
      Parameters:
      naftahTemporalAmount - the temporal amount to subtract
      Returns:
      a new ArabicDateTime instance
    • minusYears

      public NaftahDateTime minusYears(long yearsToSubtract)
      Returns a new ArabicDateTime with the specified number of years subtracted.
      Specified by:
      minusYears in interface DateSupport
      Parameters:
      yearsToSubtract - the number of years to subtract, may be negative
      Returns:
      a new ArabicDateTime with the years subtracted
    • minusMonths

      public NaftahDateTime minusMonths(long monthsToSubtract)
      Returns a new ArabicDateTime with the specified number of months subtracted.
      Specified by:
      minusMonths in interface DateSupport
      Parameters:
      monthsToSubtract - the number of months to subtract, may be negative
      Returns:
      a new ArabicDateTime with the months subtracted
    • minusWeeks

      public NaftahDateTime minusWeeks(long weeksToSubtract)
      Returns a new ArabicDateTime with the specified number of weeks subtracted.
      Specified by:
      minusWeeks in interface DateSupport
      Parameters:
      weeksToSubtract - the number of weeks to subtract, may be negative
      Returns:
      a new ArabicDateTime with the weeks subtracted
    • minusDays

      public NaftahDateTime minusDays(long daysToSubtract)
      Returns a new ArabicDateTime with the specified number of days subtracted.
      Specified by:
      minusDays in interface DateSupport
      Parameters:
      daysToSubtract - the number of days to subtract, may be negative
      Returns:
      a new ArabicDateTime with the days subtracted
    • minusHours

      public NaftahDateTime minusHours(long hoursToSubtract)
      Returns a new ArabicDateTime with the specified number of hours subtracted.
      Specified by:
      minusHours in interface TimeSupport
      Parameters:
      hoursToSubtract - the number of hours to subtract, may be negative
      Returns:
      a new ArabicDateTime with the hours subtracted
    • minusMinutes

      public NaftahDateTime minusMinutes(long minutesToSubtract)
      Returns a new ArabicDateTime with the specified number of minutes subtracted.
      Specified by:
      minusMinutes in interface TimeSupport
      Parameters:
      minutesToSubtract - the number of minutes to subtract, may be negative
      Returns:
      a new ArabicDateTime with the minutes subtracted
    • minusSeconds

      public NaftahDateTime minusSeconds(long secondsToSubtract)
      Returns a new ArabicDateTime with the specified number of seconds subtracted.
      Specified by:
      minusSeconds in interface TimeSupport
      Parameters:
      secondsToSubtract - the number of seconds to subtract, may be negative
      Returns:
      a new ArabicDateTime with the seconds subtracted
    • minusNanos

      public NaftahDateTime minusNanos(long nanosToSubtract)
      Returns a new ArabicDateTime with the specified number of nanoseconds subtracted.
      Specified by:
      minusNanos in interface TimeSupport
      Parameters:
      nanosToSubtract - the number of nanoseconds to subtract, may be negative
      Returns:
      a new ArabicDateTime with the nanoseconds subtracted
    • compute

      private NaftahDateTime compute(NaftahTemporalAmount arabicTemporalAmount, boolean plus)
      Computes a new ArabicDateTime by applying the given Arabic temporal amount using either addition or subtraction.

      Supported temporal amounts:

      Duration handling rules:

      • Durations shorter than 24 hours affect only the time component
      • Durations of 24 hours or more are split into a date-based Period and a remaining time-based Duration

      Date and time components are updated independently while the resolved Temporal is updated in full.

      Parameters:
      arabicTemporalAmount - the temporal amount to apply
      plus - true to add, false to subtract
      Returns:
      a new ArabicDateTime instance
    • toString

      public String toString()
      Returns a string representation of this ArabicDateTime in the format: "date time".

      Both NaftahDate and NaftahTime components are included.

      Specified by:
      toString in class Record
      Returns:
      a formatted string representing the Arabic date-time
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • naftahDate

      public NaftahDate naftahDate()
      Returns the value of the naftahDate record component.
      Returns:
      the value of the naftahDate record component
    • naftahTime

      public NaftahTime naftahTime()
      Returns the value of the naftahTime record component.
      Returns:
      the value of the naftahTime record component
    • temporal

      public Temporal temporal()
      Returns the value of the temporal record component.
      Specified by:
      temporal in interface NaftahTemporalPoint
      Returns:
      the value of the temporal record component