Created
April 1, 2012 12:55
-
-
Save delexi/2275164 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| sealed trait Enum | |
| case class Element1 extends Enum | |
| case class Element2 extends Enum | |
| ... | |
| case class ElementN extends Enum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
abstract class Enum(val value: Int)
// for a single instance
case object Elem1 extends Enum(1)
// for multiple instances
case class ElemX(override val value: Int) extends Enum(value)