Skip to content

Instantly share code, notes, and snippets.

@Centaur
Created June 5, 2014 08:06
Show Gist options
  • Save Centaur/9e82a26924ff41c916ed to your computer and use it in GitHub Desktop.
Save Centaur/9e82a26924ff41c916ed to your computer and use it in GitHub Desktop.
val extraVersion: Option[ExtraVersion] = e match {
case ExtraRC(no) => Some(RC(no.toInt))
case ExtraBETA(no) => Some(BETA(no.toInt))
case ExtraSNAPSHOT(date) => Some(SNAPSHOT(date))
case ExtraM(no) => Some(M(no.toInt))
case Minus(no) => Some(GA(no.toInt))
case _ => None
}
val extraVersion: Option[ExtraVersion] = Option(e match {
case ExtraRC(no) => RC(no.toInt)
case ExtraBETA(no) => BETA(no.toInt)
case ExtraSNAPSHOT(date) => SNAPSHOT(date)
case ExtraM(no) => M(no.toInt)
case Minus(no) => GA(no.toInt)
case _ => null
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment