Created
November 22, 2016 12:12
-
-
Save syedatifakhtar/e5a3b7e2a4fca9e2e6e879809c0a78ab to your computer and use it in GitHub Desktop.
Scala reflection gist for preparedStatement DBUtil reflection
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
val someMap = Map( | |
typeTag[scala.math.BigDecimal].tpe -> 0 | |
) | |
def someFun[A: TypeTag](value: Option[A]): Unit = { | |
val someType = typeTag[scala.math.BigDecimal] | |
val myType = someType.tpe | |
val targ: _root_.scala.reflect.runtime.universe.Type = typeOf[A] | |
println(s"TARG: ${targ.normalize} and mytpe = ${myType}") | |
val typeTagValue: _root_.scala.reflect.runtime.universe.TypeTag[A] = typeTag[A] | |
println(someMap.get(targ.normalize)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment