Class TimeTranslator
java.lang.Object
com.powerupsoftwareengineering.java.immutable.web.model.translator.TimeTranslator
The
TimeTranslator class is a translator that will convert different time representations between the domain model and web model
representations.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default timezone used if no timezone is provided. -
Method Summary
Modifier and TypeMethodDescriptionstatic DurationdurationFromXml(Duration jaxbDuration) Translates from the xml duration definition to the Java Duration representation.static DurationdurationToXml(Duration duration) Translates from Java Duration model object into XML Duration representation.static LocalDatelocalDateFromXml(XMLGregorianCalendar xmlGregorianCalendar) Translates from the xml date time definition to the Java Local Date representation.static LocalDateTimelocalDateTimeFromXml(XMLGregorianCalendar xmlGregorianCalendar) Translates from the xml date time definition to the Java Local Date Time representation.static XMLGregorianCalendarlocalDateTimeToXml(LocalDateTime localDateTime) Translates from Java Date Time into XML Time representation.static XMLGregorianCalendarlocalDateToXml(LocalDate localDate) Translates from Time model object into XML Time representation.static LocalTimelocalTimeFromXml(XMLGregorianCalendar xmlGregorianCalendar) Translates from the xml date time definition to the Java Local time representation.static XMLGregorianCalendarlocalTimeToXml(LocalTime localTime) Translates from Time model object into XML Time representation.static MonthmonthFromXml(String month) Translates from the xml month definition to the Java Month representation.static StringmonthToXml(Month month) Translates from Java Month model object into XML Month representation.static ZonedDateTimezonedDateTimeFromXml(XMLGregorianCalendar xmlGregorianCalendar) Translates from the xml date time definition to the Java Zoned Date Time representation.static XMLGregorianCalendarzonedDateTimeToXml(ZonedDateTime zonedDateTime) Translates from Java Date Time into XML Time representation.
-
Field Details
-
DEFAULT_TIMEZONE
The default timezone used if no timezone is provided.- See Also:
-
-
Method Details
-
zonedDateTimeFromXml
Translates from the xml date time definition to the Java Zoned Date Time representation.- Parameters:
xmlGregorianCalendar- XML Date Time representation to be translated.- Returns:
- Java Zoned Date Time representation of the date time.
-
zonedDateTimeToXml
Translates from Java Date Time into XML Time representation.- Parameters:
zonedDateTime- Java Date Time to be translated.- Returns:
- XML representation of Date Time.
-
localDateTimeFromXml
Translates from the xml date time definition to the Java Local Date Time representation.- Parameters:
xmlGregorianCalendar- XML Date Time representation to be translated.- Returns:
- Java Local Date Time representation of the date time.
-
localDateTimeToXml
Translates from Java Date Time into XML Time representation.- Parameters:
localDateTime- Java Date Time to be translated.- Returns:
- XML representation of Date Time.
-
localDateFromXml
Translates from the xml date time definition to the Java Local Date representation.- Parameters:
xmlGregorianCalendar- XML Date Time representation to be translated.- Returns:
- Java Local Date representation of the date time.
-
localDateToXml
Translates from Time model object into XML Time representation.- Parameters:
localDate- Time to be translated.- Returns:
- XML representation of Time.
-
localTimeFromXml
Translates from the xml date time definition to the Java Local time representation.- Parameters:
xmlGregorianCalendar- XML Date Time representation to be translated.- Returns:
- Java Local time representation of the date time.
-
localTimeToXml
Translates from Time model object into XML Time representation.- Parameters:
localTime- Time to be translated.- Returns:
- XML representation of Time.
-
durationFromXml
-
durationToXml
-
monthFromXml
-
monthToXml
-