Skip to content

Instantly share code, notes, and snippets.

@shkschneider
Last active May 23, 2019 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shkschneider/45e4517be571812ad29b5c504e0e8d00 to your computer and use it in GitHub Desktop.
Save shkschneider/45e4517be571812ad29b5c504e0e8d00 to your computer and use it in GitHub Desktop.
// 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