Class DateDeserializer
java.lang.Object
com.markvarga21.studentmanager.util.DateDeserializer
A utility class which is used to deserialize the
String
representation of a date.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The length of the standard passport date components. -
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDate
mapDateStringToLocalDate
(String dateString) Maps theString
representation of a date to aLocalDate
object.static String
Maps aLocalDate
object to aString
.static LocalDate
mapStandardPassportDateStringToLocalDate
(String dateString) Maps a standard passport date string to aLocalDate
.
-
Field Details
-
PASSPORT_DATE_COMPONENT_LENGTH
public static final int PASSPORT_DATE_COMPONENT_LENGTHThe length of the standard passport date components.- See Also:
-
-
Method Details
-
mapDateStringToLocalDate
Maps theString
representation of a date to aLocalDate
object.- Parameters:
dateString
- TheString
representation of a date.- Returns:
- The converted
LocalDate
object.
-
mapStandardPassportDateStringToLocalDate
Maps a standard passport date string to aLocalDate
.- Parameters:
dateString
- The date string.- Returns:
- The mapped
LocalDate
from the string itself.
-
mapLocalDateToDateString
Maps aLocalDate
object to aString
.- Parameters:
date
- TheLocalDate
object.- Returns:
- The
String
representation of the date.
-