Use sealed abstract case class
es to reduce bincompat surface
#257
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.
sealed abstract case class
es don't haveapply
orcopy
methods, but still have nicetoString
,hashCode
, andequals
.Unfortunately they still generate
unapply
methods, so I've overridden those with package-private implementations to prevent the public one from being generated.I've made the
apply
methods for events package-private. In ordinary use they should not be necessary, and importantly it protects our bincompat should AWS decide to add more non-optional fields, which technically they can do backwards-compatibly at any time.Then, we can expose
apply
methods in the testkit like I propose doing forContext
in #247. This will enable them to be mocked.I didn't finish the DynamoDB-related stuff, I think I might like to make some bigger changes there in a followup.