java.lang.Object
de.powerstat.validation.values.GregorianDate
- All Implemented Interfaces:
IValueObject,Comparable<GregorianDate>
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final GregorianCalendarGregorian calendar.private static final StringISO8601 separator.private final DayDay.private static final StringYear format.private static final StringOutput format.private static final StringIT - italy constant.private final MonthMonth.private final YearYear. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateGregorianDate(GregorianCalendar calendar, Year year, Month month, Day day) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(GregorianDate obj) Compare with another object.static GregorianDateeaster(GregorianCalendar calendar, Year year) Calculate easter date for year.booleanIs equal with another object.inthashCode()Calculate hash code.static GregorianDateof(GregorianCalendar calendar, Year year, Month month, Day day) GregorianDate factory.static GregorianDateGregorianDate factory for country=IT.static GregorianDateGregorianDate factory for country=IT.Returns the value of this GregorianDate as a string.toString()Returns the string representation of this GregorianDate.
-
Field Details
-
FORMAT_TWODIGIT
Output format.- See Also:
-
FORMAT_FOURDIGIT
Year format.- See Also:
-
DATE_SEP
ISO8601 separator.- See Also:
-
IT
IT - italy constant.- See Also:
-
calendar
Gregorian calendar. -
year
Year. -
month
Month. -
day
Day.
-
-
Constructor Details
-
GregorianDate
Constructor.- Parameters:
calendar- Gregorian calendaryear- Yearmonth- Monthday- Day
-
-
Method Details
-
of
GregorianDate factory.- Parameters:
calendar- Gregorian calendaryear- Yearmonth- Monthday- Day- Returns:
- GregorianDate object
-
of
GregorianDate factory for country=IT.- Parameters:
year- Yearmonth- Monthday- Day- Returns:
- GregorianDate object
-
of
GregorianDate factory for country=IT.- Parameters:
value- String value of ISO8601 type yyyy-mm-dd- Returns:
- GregorianDate object
-
stringValue
Returns the value of this GregorianDate as a string.- Specified by:
stringValuein interfaceIValueObject- 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. -
equals
Is equal with another object. -
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]" -
compareTo
Compare with another object.- Specified by:
compareToin interfaceComparable<GregorianDate>- Parameters:
obj- Object to compare with- Returns:
- 0: equal; 1: greater; -1: smaller
- See Also:
-
easter
Calculate easter date for year.- Parameters:
calendar- Gregorian calendaryear- Year- Returns:
- GregorianDate of easter for given year
-