Skip to content

introduce gem for enums#30

Open
hduelme wants to merge 1 commit into
mapstruct:mainfrom
hduelme:introduce-gem-enum
Open

introduce gem for enums#30
hduelme wants to merge 1 commit into
mapstruct:mainfrom
hduelme:introduce-gem-enum

Conversation

@hduelme
Copy link
Copy Markdown
Collaborator

@hduelme hduelme commented Jun 7, 2026

This PR introduces support for Java enums.
When an enum is used as a @GemDefinition value, a corresponding enum Gem is generated automatically. Additionally, other generated gems will reference the generated enum gem whenever applicable.

For cases where a custom enum implementation is required, it can be registered using @RegisterGem. In this scenario, the plugin validates that the enum constants of the custom implementation match those of the original enum, ensuring consistency between both definitions.

To avoid ambiguity, multiple registrations or generations for the same enum are not allowed.

@filiphr could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant