# MapStruct Tutorial

## ![image info](/files/Wym4GTmkZlybZqLA9e6w) *Description*

MapStruct is a complete Java Bean Mapper framework. Based on Annotation Processor (APT) mechanism to generate mappers for the individual Java beans mappings. The generated mappers are real Java-based classes that can also be debugged in the runtime. The MapStruct processor itself uses an interface/abstract class as a starting point of mappings creation (can also contain individually-matched property mapping implementations).

## ![image info](/files/LUzHaCFHWny1aP0kLPZf) *Features*

## ![image info](/files/QmErbJuFr2Rrhbdz3AEU) *Pros & Cons*

### ![image info](/files/o9Emirx7GNOCVqC9Yyww) *Pros*

* annotation-based mappings processing mechanism
* wide range of available mapping operations (with more complexity apart from Orika/Dozer)
* can be debugged in runtime in order to validate the end-to-end object mappings

### ![image info](/files/ZkvMmCSuGtnd1Xc9sSGC) *Cons*

* additional interfaces/abstract classes needed to handle the mapping mechanism
* high performance and universal applicability

## ![image info](/files/wWmQEQyZDnPtyN897NkF) *Use cases*

## ![image info](/files/ZBj89TLad7uaJDheymjX) *Links*

* [**Official Site**](https://mapstruct.org/)
* [**Official Repository**](https://github.com/mapstruct/mapstruct)
* [**Java Performance Mappings**](https://www.baeldung.com/java-performance-mapping-frameworks)
* [**Java MapStruct Guide**](https://www.baeldung.com/mapstruct)
* [**Java MapStruct Article**](https://www.codeflow.site/ru/article/mapstruct)
* [**Java MapStruct FAQ**](https://progi.pro/mapstruct-t16374)
* [**Java MapStruct Advanced**](https://stackabuse.com/guide-to-mapstruct-in-java-advanced-mapping-library/)
* [**Java MapStruct Alternatives**](https://java.libhunt.com/mapstruct-alternatives)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alexander-rogalsky.gitbook.io/object-mappers-docs/modules/mapstruct/info.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
