Skip to content

Remove warnings for fluent removers. #211

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
jarlesat opened this issue Dec 3, 2024 · 0 comments
Open

Remove warnings for fluent removers. #211

jarlesat opened this issue Dec 3, 2024 · 0 comments

Comments

@jarlesat
Copy link

jarlesat commented Dec 3, 2024

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant