Created
June 28, 2018 17:43
-
-
Save mohashari/bc3dc3e1d394ee055caf80fea6c6474d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.codecika.kotlindemo.converter | |
| import com.codecika.kotlindemo.model.domain.Student | |
| import com.codecika.kotlindemo.vo.StudentVO | |
| fun Student.toVO(): StudentVO { | |
| return StudentVO( | |
| name = name, | |
| address = address, | |
| birthday = birthday | |
| ) | |
| } | |
| fun StudentVO.toModel(): Student { | |
| return Student().apply { | |
| name = this@toModel.name | |
| address = this@toModel.address | |
| birthday = this@toModel.birthday | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment