com.github.dwickern.macros.NameOf
See theNameOf companion trait
Attributes
Members list
Value members
Inherited methods
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"
Attributes
- Inherited from:
- NameOf
Obtain an identifier name as a constant string.
Obtain an identifier name as a constant string.
Example usage:
val amount = 5
nameOf(amount) => "amount"
Attributes
- Inherited from:
- NameOf
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"
Attributes
- Inherited from:
- NameOf
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"
Attributes
- Inherited from:
- NameOf
In this article