@Component(value="cuba_DateTimeTransformations")
public class DateTimeTransformations
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
DateTimeTransformations() |
Modifier and Type | Method and Description |
---|---|
boolean |
isDateTypeSupportsTimeZones(java.lang.Class javaType)
Check if date type supports time zone conversation
|
java.lang.Object |
transformFromLocalTime(java.time.LocalTime localTime,
java.lang.Class javaType)
Obtains an instance of specified by type date object from
from LocalTime
|
java.lang.Object |
transformFromZDT(java.time.ZonedDateTime zonedDateTime,
java.lang.Class javaType)
Obtains an instance of specified by type date object from
from ZonedDateTime
LocalDate, LocalDateTime is created for default system timezone
|
protected java.lang.Object |
transformFromZdtInternal(java.time.ZonedDateTime zonedDateTime,
java.lang.Class javaType) |
java.time.LocalTime |
transformToLocalTime(java.lang.Object date)
Obtains an instance of LocalTime
from Time or Date or LocalTime or OffsetTime
|
java.lang.Object |
transformToType(java.lang.Object date,
java.lang.Class javaType,
java.time.ZoneId zoneId)
Converts a date instance to the passed java type corresponding to one of the date types.
|
java.time.ZonedDateTime |
transformToZDT(java.lang.Object date)
Obtains an instance of ZonedDateTime
from Date or LocalDate or LocalDateTime or OffsetDateTime
ZonedDateTime is created for LocalDate, LocalDateTime with default system timezone
|
protected java.time.ZonedDateTime |
transformToZDT(java.lang.Object date,
java.time.ZoneId fromZoneId) |
public static final java.lang.String NAME
public java.lang.Object transformToType(java.lang.Object date, java.lang.Class javaType, java.time.ZoneId zoneId)
date
- the date object, not null
javaType
- the java type to convert tozoneId
- the zone ID to use or null
to use default system timezonenull
public java.time.ZonedDateTime transformToZDT(java.lang.Object date)
date
- date object, not nullprotected java.time.ZonedDateTime transformToZDT(java.lang.Object date, java.time.ZoneId fromZoneId)
public java.lang.Object transformFromZDT(java.time.ZonedDateTime zonedDateTime, java.lang.Class javaType)
zonedDateTime
- date object, not nulljavaType
- date type to transformation from ZonedDateTimeprotected java.lang.Object transformFromZdtInternal(java.time.ZonedDateTime zonedDateTime, java.lang.Class javaType)
public java.time.LocalTime transformToLocalTime(java.lang.Object date)
date
- date object, not nullpublic java.lang.Object transformFromLocalTime(java.time.LocalTime localTime, java.lang.Class javaType)
localTime
- date object, not nulljavaType
- date type to transformation from LocalTimepublic boolean isDateTypeSupportsTimeZones(java.lang.Class javaType)
javaType
- - date type