Last active
May 23, 2019 12:20
-
-
Save shkschneider/45e4517be571812ad29b5c504e0e8d00 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
// User.kt | |
@Parcelize | |
data class User( | |
val id: UUID = UUID.randomUUID(), | |
val name: String? | |
) : Parcelable | |
// ScopedUser.kt | |
@Parcelize | |
data class ScopedUser( | |
val id: UUID = UUID.randomUUID() | |
) : Parcelable | |
fun User.toScopedUser() = ScopedUser( | |
id = id | |
) | |
fun ScopedUser.toUser() = User( | |
id = id | |
name = null // FIXME | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment