How can I easily get a Scala case class's name?
Posted
by pr1001
on Stack Overflow
See other posts from Stack Overflow
or by pr1001
Published on 2010-04-16T22:10:08Z
Indexed on
2010/04/16
22:13 UTC
Read the original article
Hit count: 141
Given:
case class FirstCC {
def name: String = ... // something that will give "FirstCC"
}
cass class SecondCC extends FirstCC
val one = FirstCC()
val two = SecondCC()
How can I get "FirstCC"
from one.name
and "SecondCC"
from two.name
?
© Stack Overflow or respective owner