KClass
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.0Parameters
the type of the class.
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.1Parameters
the type of the class.
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.0Parameters
the type of the class.
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.3Parameters
the type of the class.
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.8Parameters
the type of the class.
Represents a class and provides introspection capabilities. Instances of this class are obtainable by the ::class
syntax. See the Kotlin language documentation for more information.
Since Kotlin
1.8Parameters
the type of the class.
Properties
Annotations which are present on this element.
All constructors declared in this class.
true
if this class is a companion object. See the Kotlin language documentation for more information.
true
if this class or object has the data
keyword. For more information, see data class and data object in the Kotlin language documentation.
true
if this class is an inner class. See the Kotlin language documentation for more information.
true
if this class is sealed
. See the Kotlin language documentation for more information.
All functions and properties accessible in this class, including those declared in this class and all of its superclasses. Does not include constructors.
All classes declared inside this class. This includes both inner and static nested classes.
The instance of the object declaration, or null
if this class is not an object declaration.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The fully qualified dot-separated name of the class, or null
if the class is local or a class of an anonymous object.
The list of the immediate subclasses if this class is a sealed class, or an empty list otherwise.
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The simple name of the class as it was declared in the source code, or null
if the class has no name (if, for example, it is a class of an anonymous object).
The list of immediate supertypes of this class, in the order they are listed in the source code.
The list of type parameters of this class. This list does not include type parameters of outer classes.
Visibility of this class, or null
if its visibility cannot be represented in Kotlin.
Functions
Creates a new instance of the class, calling a constructor which either has no parameters or all parameters of which have a default value. If there are no or many such constructors, an exception is thrown.
Returns true
if this KClass instance represents the same Kotlin class as the class represented by other. On JVM this means that all of the following conditions are satisfied:
Returns true
if this KClass instance represents the same Kotlin class as the class represented by other. On JVM this means that all of the following conditions are satisfied:
If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class
), returns object S
.
If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class
), returns object S
.
If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class
), returns object S
.
If T is an @AssociatedObjectKey-annotated annotation class and this class is annotated with @T (S::class
), returns object S
.
Returns true
if value is an instance of this class on a given platform.
Returns true
if value is an instance of this class on a given platform.
Returns true
if value is an instance of this class on a given platform.
Returns true
if value is an instance of this class on a given platform.
Returns true
if value is an instance of this class on a given platform.
Returns true
if value is an instance of this class on a given platform.