-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Idea from @ZacSweers. Similar to AutoValue's @Memoized annotation.
If a Poko class is deeply immutable—i.e. all of its members are vals and are also deeply immutable—then there is no need to repeatedly re-calculate hashCode and toString results after their first call.
I like the feature but have a few concerns before moving forward:
- Kotlin data classes don't have this feature. Do I want to add features that data classes don't have?
- How do I want to approach adding multiple opt-in features: Does each new opt-in feature get a new annotation? Does each new annotation get a corresponding customization Gradle property? It's easy to imagine this getting out of hand. (Also applies to Option to omit
toStringgeneration #50.)
-- Possible alternative to adding new annotations would be a "mode" for Poko to operate in as a whole—but then how does it know which classes are deeply immutable? - Is it possible to have mutually exclusive opt-in features? How can I protect against that?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request