Skip to content

Instantly share code, notes, and snippets.

@ngsw-taro
Created October 10, 2014 11:49
Show Gist options
  • Save ngsw-taro/a7ad71ad463aaed13893 to your computer and use it in GitHub Desktop.
Save ngsw-taro/a7ad71ad463aaed13893 to your computer and use it in GitHub Desktop.
fun main(args : Array<String>) {
}
enum class TicketStatus {
OPEN
FIXED
}
trait Ticket {
val id: Long
val title: String
val status: TicketStatus
}
data class Issue(override val id: Long,
override val title: String,
override val status: TicketStatus = TicketStatus.OPEN): Ticket
data class Bug(override val id: Long,
override val title: String,
val description: String,
override val status: TicketStatus = TicketStatus.OPEN): Ticket
object TicketRepo {
val map: Map<Long, Ticket> = mapOf(
1L to Issue(1L, "1"),
2L to Bug(2L, "2", "hoge"),
3L to Issue(3L, "3", TicketStatus.FIXED),
4L to Bug(4L, "4", "fuga", TicketStatus.FIXED)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment