File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1010
1111 b. Transform function must take into the form of:
1212
13- ` fun fx(value: String): Any `
13+ ` fun fx(value: String): Any? `
14+
15+ where the return is the desired value of data type
1416
1517 c. Add the mapping into the ` mapTypes ` including the null value
1618
1719``` kotlin
1820 object Java8DateTime: DataTypes {
1921
2022 // transforms functions
21- override val formatDate = fun (value : String ): Any {
23+ override val formatDate = fun (value : String ): Any? {
2224 val dateFormatter = DateTimeFormatter .ofPattern(DateTimeFormats .dateFormat)
2325 return LocalDate .parse(value, dateFormatter)
2426 }
2527
2628 // transforms functions
27- override val formatDateTime = fun (value : String ): Any {
29+ override val formatDateTime = fun (value : String ): Any? {
2830 val dateTimeFormatter = DateTimeFormatter .ofPattern(" ${DateTimeFormats .dateFormat}${DateTimeFormats .dateTimeSeparator}${DateTimeFormats .timeFormat} " )
2931 return LocalDateTime .parse(value, dateTimeFormatter)
3032 }
3133
3234 // transforms functions
33- override val formatTime = fun (value : String ): Any {
35+ override val formatTime = fun (value : String ): Any? {
3436 val timeFormatter = DateTimeFormatter .ofPattern(DateTimeFormats .timeFormat)
3537 return LocalTime .parse(value, timeFormatter)
3638 }
You can’t perform that action at this time.
0 commit comments