Coder Social home page Coder Social logo

mapstruct-examples's Introduction

MapStruct Examples

This repository contains examples showing how to use MapStruct, a Java annotation processor for the generation of type-safe bean mapping classes.

Currently, the following examples exist:

  • mapstruct-on-ant: Shows how to use MapStruct in Ant-based projects; to build this example, run ant build on the command line
  • mapstruct-on-gradle: Shows how to use MapStruct in Gradle-based projects; to build the example project, run ./gradlew clean build on the command line
  • mapstruct-on-bazel: Shows how to use MapStruct in Bazel-based projects; to build the example project, run bazel build //... on the command line, to test the project, run bazel test //....
  • mapstruct-lombok: Shows how to use MapStruct together with Lombok (with both a Maven pom.xml and a Gradle build.gradle); to build the example project, run either mvn clean install or ./gradlew clean build on the command line
  • mapstruct-iterable-non-iterable: Shows how by means of a mapper util class conversions can be made from an iterable- to its non-iterable element
  • mapstruct-mapping-from-map: Shows how by means of a mapper util class and qualifiers extracting value can be carried out on Maps. Watch mapstruct/mapstruct#1075 for native support.
  • mapstruct-rounding: Shows how by means of a mapper util class and qualifiers roundings can be carried out on Numbers
  • mapstruct-updatemethods: Shows how to update an existing target object
  • mapstruct-field-mapping: Shows how MapStruct can be used with "struct" like objects with public fields
  • mapstruct-nested-bean-mappings: Shows how to map object graphs via a main root method
  • mapstruct-mapping-with-cycles: Shows how to map object graphs that can contain cycles
  • mapstruct-spi-accessor-naming: Example on how to use the Service Provider Interface (SPI) for a custom accessor naming strategy.
  • mapstruct-protobuf3: Example on how to use protobuf3 with MapStruct
  • mapstruct-kotlin: Example on how to use MapStruct with Kotlin using KAPT (Kotlin Annotation Processing Tool)
  • mapstruct-kotlin-gradle: Example on how to use MapStruct with Kotlin and Gradle Kotlin DSL using KAPT
  • mapstruct-jpa-child-parent: Example on how to use @Context in relation to parent / child relations in JPA)
  • mapstruct-suppress-unmapped: Shows how mapping to target properties can be ignored without warning by default in a mixed scenario. However bean property mappings that have the same name will still be applied.
  • mapstruct-lookup-entity-with-id: Shows how an object with composite key can be read from the database in a mapping method.
  • mapstruct-clone: Shows how an object can be deeply cloned by defining all mapping methods.
  • mapstruct-metadata-annotations: Demonstrates how to read annotations and use them as mapping instruction.
  • mapstruct-mappers-repo: Demonstrates how one can build a repo of mappers by means of code generation.

License

The examples in this project are licensed under the Apache License, Version 2.0.

mapstruct-examples's People

Contributors

filiphr avatar gunnarmorling avatar agudian avatar sjaakd avatar torstenwerner avatar chris922 avatar kevcodez avatar hongji3354 avatar rahuljoshitaulia avatar yishanhe avatar eiswind avatar thst71 avatar xqdd avatar dependabot[bot] avatar dgruntz avatar nancheung avatar patsancu avatar xenteros avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.