This repository was archived by the owner on Jan 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,31 @@ class LocalDateTimeDeserializerImpl(
220
220
}
221
221
```
222
222
223
+ ### Use default arguments
224
+ ` KRowMapper ` supports ` default arguments ` .
225
+ ` Default arguments ` are available in the following situations:
226
+
227
+ - When not referring to the acquisition result
228
+ - When the acquisition result is ` null `
229
+
230
+ As of ` KRowMapper ` 0.8, it does not support the use of ` default argument ` when columns cannot be obtained.
231
+
232
+ #### When not referring to the acquisition result
233
+ When the ` KUseDefaultArgument ` ` annotation ` is added to the parameter,
234
+ the ` default argument ` can be used forcibly without referring to the obtained result.
235
+
236
+ ``` kotlin
237
+ data class Dst (val fooId : Int , @param:KUseDefaultArgument val barValue : String = " default" )
238
+ ```
239
+
240
+ #### When the acquisition result is null
241
+ When ` KParameterRequireNonNull ` ` annotation ` is given to a parameter,
242
+ the default argument can be used if the obtained result is ` null ` .
243
+
244
+ ``` kotlin
245
+ data class Dst (val fooId : Int , @param:KParameterRequireNonNull val barValue : String = " default" )
246
+ ```
247
+
223
248
## Installation
224
249
Published on JitPack.
225
250
You can use this library on ` maven ` , ` gradle ` and any other build tools.
You can’t perform that action at this time.
0 commit comments