ํฐ์คํ ๋ฆฌ ๋ทฐ
๐โ๏ธโ๏ธโ๏ธ๐/kotlin
[kotlin] map์ผ๋ก data class list๋ผ๋ฆฌ ์๋ก ๋ณํ
pansy0319 2022. 4. 23. 18:50๋ฐ์ํ
data class User(
val id: String,
val name: String,
val age: Int,
)
data class Student(
val name: String,
val age: Int,
)
// ----------------------------------------------------
fun transform() {
val users = userRepository.findAll()
val students = users.map {
Student(
name = it.name,
age = it.age,
)
}
}
์ด๋ฐ ๋๋..!!
์ ๊น๋จน์ผ๋๊น ๊ธฐ๋กํด๋๊ธฐ
๋ฐ์ํ
'๐โ๏ธโ๏ธโ๏ธ๐ > kotlin' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[kotlin/jackson] enum serialization&deserializationํ๊ธฐ!! (0) | 2021.11.06 |
---|
๋๊ธ
๋ฐ์ํ
๊ณต์ง์ฌํญ
์ต๊ทผ์ ์ฌ๋ผ์จ ๊ธ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
- Total
- Today
- Yesterday
๋งํฌ
TAG
- ์คํ๋ง๋ถํธ
- docker pull limit
- ๋์ปค
- gradle
- kotlin In Action
- k8s
- back merge
- ๋๋ฉ์ธ์ฃผ๋์ค๊ณ
- java
- kotlin
- ImagePullBackOff
- gasmask
- ์๋ฐ์คํฌ๋ฆฝํธ
- ์๋ฐ
- QuickTimePlayer
- cacheable
- JavaScript
- linuxkit
- IntelliJ
- docker
- Kubernetes
- clean code
- ์ฟ ๋ฒ๋คํฐ์ค
- Spring
- ์ฝํ๋ฆฐ
- docker for mac
- ddd
- ์คํ๋ง
- ํด๋ฆฐ์ฝ๋
- springboot
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
๊ธ ๋ณด๊ดํจ