[Java] Get KClass in Java [Kotlin]

things to do

In Kotlin, you can get KClass as follows.

val myKClass: KClass<*> = MyClass::class

This acquisition process is performed by Java.

How to do

You can do it with JvmClassMappingKt.getKotlinClass.

final KClass<?> myKClass = JvmClassMappingKt.getKotlinClass(MyClass.class);

Recommended Posts

[Java] Get KClass in Java [Kotlin]
[Java] Get KFunction from Method / Constructor in Java [Kotlin]
Get EXIF information in Java
Get Null-safe Map values in Java
Get stuck in a Java primer
Get the result of POST in Java
[Kotlin] 3 ways to get Class from KClass
Partization in Java
Changes in Java 11
Rock-paper-scissors in Java
How to get the date in java
Get history from Zabbix server in Java
What Java programmers find useful in Kotlin
Pi in Java
FizzBuzz in Java
How to get Class from Element in Java
Get unixtime (seconds) from ZonedDateTime in Scala / Java
Library "OSHI" to get system information in Java
How to write Java String # getBytes in Kotlin?
Get along with Java containers in Cloud Run
Interpreter implementation in Java
Make Blackjack in Java
Rock-paper-scissors app in Java
Constraint programming in Java
Put java8 in centos7
NVL-ish guy in Java
[Java] Get miscellaneous dates
"Hello World" in Java
Callable Interface in Java
Comments in Java source
Azure functions in java
Format XML in Java
Simple htmlspecialchars in Java
Big Decimal in Kotlin
Boyer-Moore implementation in Java
Use OpenCV in Java
webApi memorandum in java
[Java, Kotlin] Type Variance
Type determination in Java
Ping commands in Java
[Java] Initialize, add, get
Various threads in java
Heapsort implementation (in java)
Zabbix API in Java
ASCII art in Java
Compare Lists in Java
POST JSON in Java
Express failure in Java
Create JSON in Java
Date manipulation in Java 8
What's new in Java 8
Get cookies in Spring
Use PreparedStatement in Java
What's new in Java 9,10,11
Parallel execution in Java
Initializing HashMap in Java
Browse class objects in Kotlin (instead of Java class name.class)
Write a class in Kotlin and call it in Java
Source used to get the redirect source URL in Java
Get Locale objects for all locales available in Java
[Java] Get the file in the jar regardless of the environment