Skip to content

Instantly share code, notes, and snippets.

@AOrobator
Last active February 21, 2018 00:59
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 AOrobator/f0732864bc3f01dcba8f60200c7918f4 to your computer and use it in GitHub Desktop.
Save AOrobator/f0732864bc3f01dcba8f60200c7918f4 to your computer and use it in GitHub Desktop.
sealed class SongId
data class ValidSongId(id: Long) : SongId()
object InvalidSongId : SongId()
val Song.typedId: SongId = if (this.id == -1L) InvalidSongId else SongId(this.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment