Module Mal4J

Class NullableDate

java.lang.Object
dev.katsute.mal4j.property.NullableDate

public abstract class NullableDate extends Object
A date with an optional year, month, and day. Does not convert around timezones, will return the date exactly how it is written on the website.
Since:
3.0.0
Version:
3.0.0
Author:
Katsute
See Also:
  • Constructor Details

    • NullableDate

      public NullableDate()
  • Method Details

    • getYear

      public abstract Integer getYear()
      Returns the 4 digit year (19XX-20XX). Null if the year is missing
      Returns:
      year
      Since:
      3.0.0
    • getMonth

      public abstract Integer getMonth()
      Returns the numeric month (1-12). Null if the month is missing.
      Returns:
      month
      Since:
      3.0.0
    • getDay

      public abstract Integer getDay()
      Returns the day (1-31). Null if the day is missing.
      Returns:
      day
      Since:
      3.0.0
    • getMillis

      public abstract Long getMillis()
      Returns the date as milliseconds since epoch. If the month or day is null, it will fallback to January 1st. Null if everything is missing.
      Returns:
      milliseconds since epoch
      Since:
      3.0.0
    • getDate

      public abstract Date getDate()
      Returns the date as a Date. If the month or day is null, it will fallback to January 1st. Null if everything is missing.
      Returns:
      date
      Since:
      3.0.0
      See Also: