Class GregorianDate

java.lang.Object
de.powerstat.validation.values.GregorianDate
All Implemented Interfaces:
IValueObject, Comparable<GregorianDate>

public final class GregorianDate extends Object implements Comparable<GregorianDate>, IValueObject
Gregorian calendar date. Not DSGVO relevant. TODO next day TODO previous day TODO add x days TODO subtract x days TODO add days, months, years TODO subtract days, months, years TODO getJD TODO getMJD TODO getWeekday TODO date - date = days TODO date - date = days, months, years TODO get WeekNr TODO format date TODO parse date TODO min, max
  • Field Details

  • Constructor Details

    • GregorianDate

      private GregorianDate(GregorianCalendar calendar, Year year, Month month, Day day)
      Constructor.
      Parameters:
      calendar - Gregorian calendar
      year - Year
      month - Month
      day - Day
  • Method Details

    • of

      public static GregorianDate of(GregorianCalendar calendar, Year year, Month month, Day day)
      GregorianDate factory.
      Parameters:
      calendar - Gregorian calendar
      year - Year
      month - Month
      day - Day
      Returns:
      GregorianDate object
    • of

      public static GregorianDate of(Year year, Month month, Day day)
      GregorianDate factory for country=IT.
      Parameters:
      year - Year
      month - Month
      day - Day
      Returns:
      GregorianDate object
    • of

      public static GregorianDate of(String value)
      GregorianDate factory for country=IT.
      Parameters:
      value - String value of ISO8601 type yyyy-mm-dd
      Returns:
      GregorianDate object
    • stringValue

      public String stringValue()
      Returns the value of this GregorianDate as a string.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The text value represented by this object after conversion to type string in ISO8601 format with - as separator.
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this GregorianDate. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "GregorianDate[country=IT, date=2020-07-06]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this GregorianDate
      See Also:
    • compareTo

      public int compareTo(GregorianDate obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<GregorianDate>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also:
    • easter

      public static GregorianDate easter(GregorianCalendar calendar, Year year)
      Calculate easter date for year.
      Parameters:
      calendar - Gregorian calendar
      year - Year
      Returns:
      GregorianDate of easter for given year