Created
October 30, 2015 21:54
-
-
Save robfletcher/cf7760c1d87f70b0f07e 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
import sbt._ | |
scalaVersion := "2.11.7" | |
resolvers += Resolver.jcenterRepo | |
libraryDependencies ++= Seq( | |
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.5.2" | |
) |
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
import com.fasterxml.jackson.annotation.JsonSubTypes.Type | |
import com.fasterxml.jackson.annotation.JsonTypeInfo.Id | |
import com.fasterxml.jackson.annotation.{JsonSubTypes, JsonTypeInfo} | |
@JsonTypeInfo(use = Id.NAME, property = "name") | |
@JsonSubTypes(Array( | |
new Type(classOf[Vodka.type]), | |
new Type(classOf[Whiskey]) | |
)) | |
trait Spirit | |
case object Vodka extends Spirit | |
case class Whiskey(variety: String) extends Spirit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment