Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit f9f69c7

Browse files
committed
入力の優先度
1 parent 8728541 commit f9f69c7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,3 +611,15 @@ If the argument is `String`, the input will be `toString`.
611611
**4. Conversion using the mapper class**
612612
If the transformation does not meet the criteria so far, a mapping process is performed using a mapper class.
613613
For this mapping process, `PlainKMapper` is used for `PlainKMapper`, and `BoundKMapper` is used for others.
614+
615+
### Input priority
616+
The `KMapper` basically gives priority to the first available argument.
617+
For example, in the following example, since `param1` is given first as `value1`, the next input `param1" to "value2"` is ignored.
618+
619+
```kotlin
620+
val mapper: KMapper<Dst> = ...
621+
622+
val dst = mapper.map("param1" to "value1", "param1" to "value2")
623+
```
624+
625+
However, if `null` is specified as an input for an argument with a `KParameterRequireNonNull` annotation, it is ignored and the later argument takes precedence.

0 commit comments

Comments
 (0)