A declarative Java library for testable object-to-object mapping with automatic field mapping and validation.
ReMap is a declarative object mapping library for Java that simplifies converting objects from one type to another. It reduces boilerplate code by automatically mapping fields with the same name and type, while allowing custom transformations for differences. The library focuses on making mapper classes easy to write and test, with built-in validation and a fluent API.
Java developers working on applications that require frequent object transformations, such as converting database entities to DTOs, API request/response mapping, or data layer abstractions.
Developers choose ReMap because it minimizes the amount of code that needs to be unit-tested, provides compile-time safety through method references, and offers a clean, declarative way to handle complex mapping scenarios with validation and Spring integration.
A declarative mapping library to simplify testable object mappings.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows concise mapping definitions using method references, reducing boilerplate code compared to manual mapping, as shown in the demo snippet with reassign and replace operations.
Maps fields with equal names and types automatically, minimizing configuration effort for standard cases, which is core to its 'configure only differences' philosophy.
Validates mapping configuration at mapper instantiation, catching errors early by ensuring all fields are covered and no conflicts exist, as detailed in the validation section.
Handles custom functions, type mappings, and nested collections/maps, with examples in the cookbook for complex scenarios like property paths and collection conversions.
Provides an assertion API specifically for testing mapping specifications, making regression testing straightforward and reducing the need for custom unit tests.
Requires strict adherence to Java Bean conventions, including public getters/setters and a no-args constructor, which can be restrictive for modern or immutable object designs.
The README admits generics cannot be used without limitations, as type information is lost due to class literals, complicating mappings with advanced generic types.
Migration guides show breaking changes between versions, such as deprecated map-into features and API shifts, which can complicate upgrades and long-term maintenance.
Explicitly does not support circular references, limiting usability in domains with complex object graphs, such as certain ORM or graph-based data models.