Refactor documentation for Java Records and Kotlin Data Classes #2932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #2896
@timyates @sdelamo see what you think about this. It is in draft and can use some cleanup, but I'd like feedback on this approach:
This is meant to solve two problems:
docs-examples
for Java. If a user selects a Kotlin or Groovy tab for snippets in the documentation, then nothing at all shows for the examples in the Java Records section (as reported in the issue linked from this PR).I have taken an approach to unify the documentation for using Java Records and Kotlin Data Classes (and use POGOs for Groovy). This has the benefit – I think – that users can see inline the differences using Java records, Kotlin data classes, and Groovy POGOs.
The original Java Records example has a lot more code examples, but they are not used as snippets in the documentation. I left them as is, but did not create Kotlin and Groovy versions. I can do that if we want to be completely consistent across the docs-examples for all three languages.