mapstruct / mapstruct.org

Web site of the MapStruct project
63 stars 40 forks source link

Default to null if empty String #80

Closed anat0lius closed 6 years ago

anat0lius commented 6 years ago

Could I configure the mapper to map the target to null if the source of a type String is empty "" ?

filiphr commented 6 years ago

@avk2 this is not the place to ask questions. Please use StackOverflow or our forum for asking questions.

In any case this is currently not possible. However, you can add a custom presence check method in your bean that would return true if your string is not null and not empty