Hi, how can I set an argument of a data class as h...
# getting-started
a
Hi, how can I set an argument of a data class as having a
internal set
?
a
hope that helps 😄
e
maybe not a concern in your case specifically, but in general `internal`/`private` doesn't really work for a data class constructor parameters; external code can always
.copy()
and change anything
if you have any significant logic or API/ABI requirements, then
data class
is probably not the right tool
a
Yes I know but I'm using https://github.com/komapper/komapper which requires data classes for the wrappers so I don't really have a choice for this But I'll use a private field with a different name plus a getter to the real field and use annotations to rename them to what Komapper wants