# mapstruct-support Additional DefaultAccessorNamingStrategy to support fluent API withXYZ setters. Mapstruct default naming strategy detects the methods `withFirstName` and `withLastName` (see example below) as extra target fields are therefore cause an error, when the mapper is annotated with `unmappedTargetPolicy = ReportingPolicy.ERROR`. ## Installation To use the extended naming strategy, just include it as project dependency alongside with mapstruct. ```xml org.mapstruct mapstruct 1.4.2.Final de.muehlencord.mapstruct mapstruct-support 1.4.2 ``` ## Example ```java public class Person { private String firstName; private String lastName; // standard getter / setter - these are covered by mapstruct by default */ public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } /* fluent setter - these are detected as extra setters and would cause an mapping exception, if the mapper is annotated with unmappedTargetPolicy = ReportingPolicy.ERROR. */ public Person withFirstName(String firstName) { this.firstName = firstName; return this; } public Person withLastName(String lastName) { this.lastName = lastName; return this; } } ```