Skip to content

Commit b0107c1

Browse files
author
Victor Harlan D. Lacson
committed
Updated custom data type documents
1 parent 5d95865 commit b0107c1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,29 @@
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
}

0 commit comments

Comments
 (0)