Class IncompleteDate
java.lang.Object
be.vlaanderen.vip.magda.client.domain.dto.IncompleteDate
Information on a date of which some parts may not be given (for instance, a birthdate that is not exactly known).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe manner in which a date is incomplete. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionProvides information on which parts are and are not given.intGet the information on the day of month part.static IncompleteDatefromString(String value) intmonth()Get the information on the month part.intyear()Get the information on the year part.
-
Field Details
-
INCOMPLETE_DATE_PATTERN
-
-
Method Details
-
fromString
-
year
public int year()Get the information on the year part.- Returns:
- The year as an integer.
- Throws:
IncompleteDateMissingPartException- if the year part is not given.
-
month
public int month()Get the information on the month part.- Returns:
- The month as an integer.
- Throws:
IncompleteDateMissingPartException- if the month part is not given.
-
dayOfMonth
public int dayOfMonth()Get the information on the day of month part.- Returns:
- The day of month as an integer.
- Throws:
IncompleteDateMissingPartException- if the day of month part is not given.
-
completenessType
Provides information on which parts are and are not given. It's strongly recommended to branch on the completeness type prior to handling the incomplete date in any other way. Otherwise,IncompleteDateMissingPartExceptions cannot be ruled out. -
toLocalDate
- Returns:
- The date information as a LocalDate.
- Throws:
IncompleteDateMissingPartException- if the date information is not complete.
-
toTextualRepresentation
- Returns:
- The date in textual representation yyyy-MM-dd
-