Created
October 10, 2014 11:49
-
-
Save ngsw-taro/a7ad71ad463aaed13893 to your computer and use it in GitHub Desktop.
This file contains 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
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