KClass<T extends Any> class abstract interface

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.

Implemented types
Available extensions

Properties

annotations List<Annotation>
Annotations which are present on this element.
no setterinherited
constructors Collection<KFunction<T>>
All constructors declared in this class.
no setter
hashCode int
The hash code for this object.
no setterinherited
isAbstract Boolean
Returns true if this class is abstract.
no setter
isCompanion Boolean
Returns true if this class is a companion object.
no setter
members Collection<KCallable>
Annotations which are present on this element.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
simpleName String?
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).
no setter
starProjectedType KType

Available on KClassifier, provided by the KClassifierExtension extension

Creates an instance of KType with the given classifier, substituting all its type parameters with star projections.
no setter
supertypes List<KType>
The list of immediate supertypes of this class, in the order they are listed in the source code.
no setter
typeParameters List<KTypeParameter>
The list of type parameters of this class.
no setter
visibility KVisibility?
Visibility of this class, or null if its visibility cannot be represented in Kotlin.
no setter

Methods

createType({List<KTypeProjection> arguments = const [], List<Annotation> annotations = const [], Boolean nullable = false}) KType

Available on KClassifier, provided by the KClassifierExtension extension

Creates a KType instance with the given classifier, type arguments, nullability and annotations.
isInstance(Any? value) Boolean
Returns true if value is an instance of this class on a given platform.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited