Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@le0nidas
Created March 20, 2022 08:22
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 le0nidas/0ea5bf686fb874367951da1f4b3ad9b1 to your computer and use it in GitHub Desktop.
Save le0nidas/0ea5bf686fb874367951da1f4b3ad9b1 to your computer and use it in GitHub Desktop.
@Parcelize
class Task(
val id: Int,
val description: Description,
val priority: Priority = Normal,
val status: Status = NotStarted,
val attachment: Attachment? = null
) : Parcelable
@Parcelize
class Attachment(val path: String) : Parcelable
@Parcelize
@JvmInline
value class Description(val value: String) : Parcelable
enum class Priority {
Low,
Normal,
High
}
sealed class Status : Parcelable {
@Parcelize
object NotStarted : Status()
@Parcelize
object InProgress : Status()
@Parcelize
class Completed(val completedAt: LocalDate) : Status()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment