mapstruct-patterns
CommunityCompile-time safe MapStruct mappings for Jakarta
Software Engineering#CDI#type-safety#compile-time#mapstruct#constructor-based#Jakarta EE#mapper-patterns
Authoremvnuel
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill enforces compile-time safety for MapStruct mappings by using constructor-based mapping and a default-constructor annotation pattern, preventing runtime surprises when constructors change.
Core Features & Use Cases
- Constructor-based mapping discipline: MapStruct binds to a constructor signature, causing compilation errors if signatures change, ensuring stability.
- Custom @Default pattern: Demonstrates selecting a preferred constructor via a user-defined annotation to drive mapping behavior.
- CDI and records support: Shows CDI integration and how Java Records map naturally with constructor-based approaches.
- Compile-time safety benefits: Highlights how updates to constructors require mapper changes to compile, reducing drift between model and DTOs.
- ** Cookbook reference patterns**: Provides starter patterns for entity mapping, record mapping, and related scenarios.
Quick Start
Create a CDI-based MapStruct mapper for an entity using a Default constructor annotation to guide the selected constructor and ensure compile-time safety.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: mapstruct-patterns Download link: https://github.com/emvnuel/SKILL.md/archive/main.zip#mapstruct-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.