mapstruct/mapstruct

Introduce dedicated `nullValueIterablePropertyMappingStrategy` and `nullValueMapPropertyMappingStrategy`

Ouverte

#3 387 ouverte le 16 sept. 2023

 (1 commentaire) (0 réaction) (0 personne assignée)Java (904 forks)batch import
enhancementgood first issue

Métriques du dépôt

Stars
 (6 640 étoiles)
Métriques de merge PR
 (Merge moyen 7j 19h) (10 PRs mergées en 30 j)

Description

Discussed in https://github.com/mapstruct/mapstruct/discussions/3380

Originally posted by drahkrub September 11, 2023 Since 1.5.0 the nullValueMappingStrategy can be separately defined for Iterables and Maps via nullValueIterableMappingStrategy and nullValueMapMappingStrategy respectively.

It would be nice to do the same for nullValuePropertyMappingStrategy by introducing nullValueIterablePropertyMappingStrategy and nullValueMapPropertyMappingStrategy.

(by the way, I would have found nullValueCollectionMappingStrategy more appropriate than nullValueIterableMappingStrategy)

This would also facilitate the introduction of another NullValuePropertyMappingStrategy, but for that I'll start a new discussion: https://github.com/mapstruct/mapstruct/discussions/3381.

Guide contributeur