Skip to content

Is it possible to convert data class in kotlin to java bean class in java #1243

Answered by smyrick
xhaimxd asked this question in Q&A
Discussion options

You must be logged in to vote

The reflection code today is entirely based on Kotlin reflections, so no, we could not generate a schema from java code.

The generated kotlin compiler code is not something that we control, that. would be from the Kotlin team. You can write your code in Kotlin like that if you want to, that is still valid. If you do so you just miss out on all the short-hand help the compiler is giving. You probably shouldn't need to worry much about what type of code the compiler is generating for you. They Kotlin team has many reasons for why they generate their JVM bytecode in a specific way.

You could write the class like this but I still think this would generate a getter in bytecode anyway

// Valid …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by smyrick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants