mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

Remove warnings for fluent removers.

Open jarlesat opened this issue 1 year ago • 0 comments

If issue#3072 in mapstruct is merged the idea-plugin will give false errors for fluent remover's.

Given the Source class:

public class Source {
    private List<String> strings = new ArrayList<>();
    public List<String> getStrings() {
        return strings;
    }
    public void setStrings(List<String> strings) {
        this.strings = strings;
    }
}

and the Target class:

public class Target {
    private List<String> strings = new ArrayList<>();
    public List<String> getStrings() {
        return strings;
    }
    public void setStrings(List<String> strings) {
        this.strings = strings;
    }
    public Target strings(List<String> strings) {
        this.strings.addAll( strings );
        return this;
    }
    public Target addString(String string) {
        strings.add( string );
        return this;
    }
    public Target removeString(String string) {
        strings.remove( string );
        return this;
    }
}

and finally this Mapper:

@Mapper
public interface MapperWithRemoverInTarget {
    Target map(Source source);
}

the plugin should no longer produce any warnings nor errors.

jarlesat avatar Dec 03 '24 12:12 jarlesat