Automapper for Java [closed]
Asked Answered
S

3

53

Is there Java equivalent of .Net's Automapper?

Singlehandedly answered 23/7, 2010 at 14:19 Comment(2)
If you could tell us what Automapper does in .NET, then we Java-freaks could answer as well ;-)Patrizia
Despite this question being closed, it contains a lot of great information! There are many other mappers not mentioned here. Please see this article for a great comparison of examples and performance (2018): baeldung.com/java-performance-mapping-frameworksCards
D
27

Checkout the Dozer project.

Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping.

It makes use of BeanUtils and extends on it.

Dianoia answered 13/9, 2010 at 20:17 Comment(1)
Future readers, keep in mind that Dozer is one of the slowest mappers available. This may or may not matter for you depending on your usage :)Cards
D
23

Check out my ModelMapper. It was inspired by AutoMapper, but adds a few new things such as intelligent mapping.

ModelMapper is an intelligent object mapping framework that eliminates the need to manually map objects to each other. It uses a convention-based approach to map objects while providing a simple refactoring safe API for handling specific mapping scenarios.

http://modelmapper.org

Also a brief blog post from Jimmy Bogard, the creator of AutoMapper:

http://lostechies.com/jimmybogard/2012/09/17/automapper-for-java/

Dietz answered 24/6, 2011 at 5:8 Comment(2)
Be aware of this issue if writting custom mappings: github.com/jhalterman/modelmapper/issues/87 I just ran in to this one at it's thrown a bit of a spanner in the works!Reticulum
ModelMapper appears really powerful. As someone coming from C#/AutoMapper background, I would recommend checking this out.Unrig
A
2

You should check the open source project Beanutils from Apache Commons.

Acred answered 23/7, 2010 at 14:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.