question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optionally generate also Kotlin data class implementations of the EntityViews

See original GitHub issue

Although even currently the generated java classes have the full-arg constructor, data classes still bring additional benefits:

  • copy method
  • default property values (could be generated from default view interface methods if present)

Moreover, data classes already have suitable equals/hashCode, so the code should be simpler to generate.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
beikovcommented, Oct 18, 2022

That I could use data classes (possibly nested) for simple immutable entity views?

Yes

Any ETA for the fix?

I’ll fix it for 1.6.8, but I need to debug some annotation processor issues first. I hope I can finish all that this week.

0reactions
david-kubeckacommented, Oct 18, 2022

Thanks! What can I expect once #1575 is fixed? That I could use data classes (possibly nested) for simple immutable entity views? Any ETA for the fix?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Data classes | Kotlin
In Kotlin, these are called data classes and are marked with data : ... and meaningful behavior of the generated code, data classes...
Read more >
Kotlin Data Class With Optional Fields - Baeldung
In this tutorial, we'll show how to create a class instance with optional fields. First, we'll show how to do it with a...
Read more >
Best Practices and Common Pitfalls of Using JPA (Hibernate ...
Let's look at how to avoid the common pitfalls and make the most of using Kotlin. Spoiler alert: data classes are not the...
Read more >
Deep Dive Into Kotlin Data Classes for Android
The primary constructor on a data class can only declare properties. You can optionally create a secondary constructor, but it must delegate to ......
Read more >
Kotlin data class optional variable - Stack Overflow
I think that's pretty much the only way to go. You could make firstName and lastName non-nullable, but that won't really change much...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found