Inspektion

The result of inspekting a class.

Properties

Link copied to clipboard
open override val allAnnotations: List<AnnotationInfo>

All annotations on this class with their source information.

Link copied to clipboard
open override val annotations: List<Annotation>

The annotations on the class.

Link copied to clipboard

The companion object instance, if this class has one.

Link copied to clipboard

The companion object instance, if this class has one.

Link copied to clipboard

The class's constructors.

Link copied to clipboard
open override val declaredAnnotations: List<Annotation>

Annotations declared directly on this class.

Link copied to clipboard

The functions that were declared in this class. Includes overrides. Does not include functions that were just inherited from supertypes.

Link copied to clipboard

The properties that were declared in this class. Includes overrides. Does not include properties that were just inherited from supertypes.

Link copied to clipboard

The class's functions. Includes functions inherited from superclasses. Does not include property accessors.

Link copied to clipboard

True if the class is an abstract class or interface. If true, attempting to call constructors will fail. Constructors may still be present for abstract classes.

Link copied to clipboard

The class that was inspekted.

Link copied to clipboard

The qualified name of the class.

Link copied to clipboard

The object instance, if the class is an object.

Link copied to clipboard

The primary constructor of this class, if it has one.

Link copied to clipboard

The class's properties. Includes properties inherited from superclasses.

Link copied to clipboard

Any sealed (direct) subclasses of this class.

Link copied to clipboard

The short name of this class, i.e. its own declaration name.

Link copied to clipboard

The class's superclasses, as KClasss.

Link copied to clipboard

The class's supertypes.

Link copied to clipboard

The class's type parameters.

Functions

Link copied to clipboard
inline fun <T> AnnotatedElement.annotation(): T?

Get the first annotation of type T, or null if none is found.

Link copied to clipboard

Get all annotations of type T.

Link copied to clipboard
inline fun callFunction(receiver: T?, name: String, argumentsBuilder: ArgumentsBuilder = {}): Any?

Call the single function named name with receiver and argumentsBuilder.

Link copied to clipboard
inline fun callPrimaryConstructor(argumentsBuilder: ArgumentsBuilder = {}): T

Calls the primary constructor of this class with argumentsBuilder.

Link copied to clipboard
inline suspend fun callSuspendFunction(receiver: T?, name: String, argumentsBuilder: ArgumentsBuilder = {}): Any?

Call the single function named name with receiver and argumentsBuilder.

Link copied to clipboard
fun cast(value: Any): T

Casts value to this class. This is the same as using the as operator. Can be checked ahead of time with isInstance (aka is), and done safely with safeCast (aka as?).

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Gets the single function named name.

Link copied to clipboard
inline operator fun get(receiver: T?, name: String, crossinline argumentsBuilder: ArgumentsBuilder = {}): Any?

Gets the value of the single property named name with receiver and argumentsBuilder.

Link copied to clipboard
inline fun getProperty(receiver: T?, name: String, crossinline argumentsBuilder: ArgumentsBuilder = {}): Any?

Gets the value of the single property named name with receiver and argumentsBuilder.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
inline operator fun invoke(argumentsBuilder: ArgumentsBuilder = {}): T

Calls the primary constructor of this class with argumentsBuilder.

inline operator fun invoke(receiver: T?, name: String, argumentsBuilder: ArgumentsBuilder = {}): Any?

Call the single function named name with receiver and argumentsBuilder.

Link copied to clipboard
fun isInstance(value: Any): Boolean

Returns true if value is an instance of this class. This is the same as using the is operator.

Link copied to clipboard
fun isSubtypeOf(other: KClass<*>): Boolean

Returns true if this is a subtype of other.

Link copied to clipboard

Gets the single property named name.

Link copied to clipboard
fun safeCast(value: Any): T?

Attempts to cast value to this class, and returns null if it is not possible. This is the same as using the as? operator.

Link copied to clipboard
operator fun set(receiver: T?, name: String, value: Any?)

Sets the value of the single property named name to value with receiver.

operator fun set(receiver: T?, name: String, argumentsBuilder: ArgumentsBuilder)

Sets the value of the single property named name with receiver and arguments argumentsBuilder.

Link copied to clipboard
inline fun setProperty(receiver: T?, name: String, crossinline argumentsBuilder: ArgumentsBuilder = {})

Sets the value of the single property named name with receiver and argumentsBuilder.

inline fun setProperty(receiver: T?, name: String, value: Any?, crossinline argumentsBuilder: ArgumentsBuilder = {})

Sets the value of the single property named name to value with receiver and argumentsBuilder additional arguments.

Link copied to clipboard
open override fun toString(): String
fun toString(includeSubclasses: Boolean, includeDescendents: Boolean = includeSubclasses): String