Package-level declarations

Functions and annotations specific to the Java platform.

Functions and annotations specific to the Java platform.

Types

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class PurelyImplements(val value: String)

Instructs the Kotlin compiler to treat annotated Java class as pure implementation of given Kotlin interface. "Pure" means here that each type parameter of class becomes non-platform type argument of that interface.

Since Kotlin 1.0
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.CONSTRUCTOR])
annotation class Throws(val exceptionClasses: KClass<out Throwable>)

This annotation indicates what exceptions should be declared by a function when compiled to a JVM method.

Since Kotlin 1.0

Functions

Link copied to clipboard
fun <T : Any> Array<*>.isArrayOf(): Boolean

Checks if array can contain element of type T.

Since Kotlin 1.0

Properties

Link copied to clipboard
val <T : Annotation> T.annotationClass: KClass<out T>

Returns a KClass instance corresponding to the annotation type of this annotation.

Since Kotlin 1.0
Link copied to clipboard
@get:JvmName(name = "getJavaClass")
val <T> KClass<T>.java: Class<T>

Returns a Java Class instance corresponding to the given KClass instance.

Since Kotlin 1.0
Link copied to clipboard
val <T : Any> T.javaClass: Class<T>

Returns the runtime Java class of this object.

Since Kotlin 1.0
@get:JvmName(name = "getRuntimeClassOfKClassInstance")
val <T : Any> KClass<T>.javaClass: Class<KClass<T>>
Since Kotlin 1.0
Link copied to clipboard
val <T : Any> KClass<T>.javaObjectType: Class<T>

Returns a Java Class instance corresponding to the given KClass instance. In case of primitive types it returns corresponding wrapper classes.

Since Kotlin 1.0
Link copied to clipboard
val <T : Any> KClass<T>.javaPrimitiveType: Class<T>?

Returns a Java Class instance representing the primitive type corresponding to the given KClass if it exists.

Since Kotlin 1.0
Link copied to clipboard
@get:JvmName(name = "getKotlinClass")
val <T : Any> Class<T>.kotlin: KClass<T>

Returns a KClass instance corresponding to the given Java Class instance.

Since Kotlin 1.0