Questions tagged «modelmapper»

8
将Kotlin数据对象映射到数据对象的更好方法
我想将一些“数据”类对象转换/映射为类似的“数据”类对象。例如,Web表单的类到数据库记录的类。 data class PersonForm( val firstName: String, val lastName: String, val age: Int, // maybe many fields exist here like address, card number, etc. val tel: String ) // maps to ... data class PersonRecord( val name: String, // "${firstName} ${lastName}" val age: Int, // copy of age // maybe …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.