Class Name
A fully-qualified class name for top-level and member classes.
Constructors
Returns a class name created from the given parts. For example, calling this with package name "java.util" and simple names "Map", "Entry" yields Map.Entry.
Returns a class name created from the given parts. For example, calling this with package name "java.util" and simple names "Map", "Entry" yields Map.Entry.
Properties
Fully qualified name using . as a separator, like kotlin.collections.Map.Entry.
Package name, like "kotlin.collections" for Map.Entry.
Simple name of this class, like "Entry" for Map.Entry.
The enclosing classes, outermost first, followed by the simple name. This is ["Map", "Entry"] for Map.Entry.
Functions
Callable reference to the constructor of this class. Emits the enclosing class if one exists, followed by the reference operator ::, followed by either simpleName or the fully-qualified name if this is a top-level class.
Returns the enclosing class, like Map for Map.Entry. Returns null if this class is not nested in another class.
Returns a new ClassName instance for the specified name as nested inside this class.
Returns a parameterized type, applying typeArguments to this.
Returns a parameterized type, applying typeArgument to this.
Fully qualified name using . to separate package from the top level class name, and $ to separate nested classes, like kotlin.collections.Map$Entry.
Returns the top class in this nesting group. Equivalent to chained calls to ClassName.enclosingClassName until the result's enclosing class is null.