Obtain an identifier name as a constant string.
Obtain an identifier name as a constant string.
This overload can be used to access an instance method without having an instance of the type.
Example usage:
class Person(val name: String) nameOf[Person](_.name) => "name"
Obtain an identifier name as a constant string.
Obtain an identifier name as a constant string.
Example usage:
val amount = 5 nameOf(amount) => "amount"
Obtain a type's unqualified name as a constant string.
Obtain a type's unqualified name as a constant string.
Example usage:
nameOfType[String] => "String" nameOfType[fully.qualified.ClassName] => "ClassName"
Obtain a type's qualified name as a constant string.
Obtain a type's qualified name as a constant string.
Example usage:
nameOfType[String] => "java.lang.String" nameOfType[fully.qualified.ClassName] => "fully.qualified.ClassName"