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

Commit 64ebe5f

Browse files
committed
引数名にエイリアスを設定する
1 parent 9136068 commit 64ebe5f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,20 @@ data class Src(
524524
val _foo: Int
525525
)
526526
```
527+
528+
#### Set an alias to an argument name
529+
It is best to use the `KParameterAlias` annotation if you want to change the name of the `_bar` field of the `Dst` class only at mapping time in the following code.
530+
531+
```kotlin
532+
data class Dst(val _bar: Int)
533+
data class Src(val bar: Int)
534+
```
535+
536+
The actual grant is as follows.
537+
538+
```kotlin
539+
data class Dst(
540+
@KParameterAlias("bar")
541+
val _bar: Int
542+
)
543+
```

0 commit comments

Comments
 (0)