NameOf

com.github.dwickern.macros.NameOf
See theNameOf companion trait
object NameOf extends NameOf

Attributes

Companion
trait
Graph
Supertypes
trait NameOf
class Object
trait Matchable
class Any
Self type
NameOf.type

Members list

Value members

Inherited methods

transparent inline def nameOf[T](inline expr: T => Any): String

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
transparent inline def nameOf(inline expr: Any): String

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
transparent inline def nameOfType[T]: String

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
transparent inline def qualifiedNameOfType[T]: String

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