It’s my pleasure to announce the second Beta release of MapStruct 1.5.
The new release comes with new functionality and some bug fixes, e.g.:
- Support for subclass mapping
NullValueMappingStrategyfor maps / collections
- New built-in conversions
- Generate imports only for Top level types
Altogether, not less than 32 issues were fixed for this release.
This would not have been possible without our fantastic community of contributors:
our latest MapStruct contributor Ben Zegveld
Thank you everyone for all your hard work!
After our first Beta release of 1.5 in the summer, we are proud to present you with the second Beta of the 1.5 release.
We’d like to thank our community for the feedback on our first Beta release and for their contributions. With this release we are happy to announce that our small team of contributors now includes Ben Zegveld.
Enough of the pep talk, let’s take a closer look at some of the new features and enhancement!
MapStruct has had the
NullValueMappingStrategy to control what to do when the source argument of the mapping method equals
This strategy has controlled the mapping for beans, collections and maps.
Starting from this release there is an option to define different strategy for collections and maps separately through:
MapperConfig#nullValueIterableMappingStrategy- for collections / iterables
MapperConfig#nullValueMapMappingStrategy- for maps
We have extensive number of built-in conversions between different types. As of this release we have 1 more:
- Diagnostics now show up on the Mapper type - All errors are now shown on the mapper type itself. This helps locate problems when extending from base mappers
- Generate imports only for top level classes
- Iterable type to non-iterable type error no longer reported when using multi source mapping
suppressTimestampInGeneratedin has been exposed in the
- Provide all available case transformations when an unknown is used in
unmappedSourcePolicyas an annotation processor argument
- Update methods with a return type always return the target object (annotated with
@MappingTarget). Prior to this release update mappings with a return type returned
nullwhen the source parameter was
This concludes our tour through MapStruct 1.5 Beta2. If you’d like to try out the features described above, you can fetch the new release from Maven Central using the following GAV coordinates:
- Annotation JAR: org.mapstruct:mapstruct:1.5.0.Beta2
- Annotation processor JAR: org.mapstruct:mapstruct-processor:1.5.0.Beta2
Alternatively, you can get ZIP and TAR.GZ distribution bundles - containing all the JARs, documentation etc. - from GitHub.
If you run into any trouble or would like to report a bug, feature request or similar, use the following channels to get in touch: