Dozer offers such a facility through its mapping configuration, for example,
<configuration>
<trim-strings>true</trim-strings>
</configuration>
Also see Dozer Global Configuration
With MapStruct 1.0.0.Final I can achieve this through Expressions or Before/After Mapping customization.
But wanted to know if there is a better way to handle such use cases.
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "mapstruct-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstruct-use...@googlegroups.com.
To post to this group, send email to mapstru...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Venkat,We don't have that at the moment. But you can use implement a custom method to donthe trimming, e.g.:String trimmed(String s) { return s != null ? s.trim() : null; }If you want only some String properties to be trimmed, just add a qualifier Annotation to that method (you could call it @Trimmed or something). See the reference docs for an example how to do it. (I'm on my phone here only, so pardon my formatting)Andreas
Am Montag, 1. August 2016 schrieb Venkat Srinivasan :
Hi,--Is there a global setting n MapStruct that one can use to trim string values.Dozer offers such a facility through its mapping configuration, for example,
<configuration> <trim-strings>true</trim-strings> </configuration>
Also see Dozer Global Configuration
With MapStruct 1.0.0.Final I can achieve this through Expressions or Before/After Mapping customization.
But wanted to know if there is a better way to handle such use cases.
Thanks in advance.
I had raised this question in StackOverflow not realising this group is active.ThanksVenkat
You received this message because you are subscribed to the Google Groups "mapstruct-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstruct-users+unsubscribe@googlegroups.com.
To post to this group, send email to mapstruct-users@googlegroups.com.