#1601 Immutables fluent getters support#3914
Draft
thmasker wants to merge 7 commits intomapstruct:mainfrom
Draft
#1601 Immutables fluent getters support#3914thmasker wants to merge 7 commits intomapstruct:mainfrom
thmasker wants to merge 7 commits intomapstruct:mainfrom
Conversation
…into 1601-immutables-fluent-getters
Author
|
Closes #1601 |
filiphr
requested changes
Aug 24, 2025
Comment on lines
+28
to
+32
| private boolean isFluentGetter(ExecutableElement method) { | ||
| return method.getParameters().isEmpty() && | ||
| method.getReturnType().getKind() != TypeKind.VOID && | ||
| !JAVA_JAVAX_PACKAGE.matcher( method.getEnclosingElement().asType().toString() ).matches(); | ||
| } |
Member
There was a problem hiding this comment.
I don't think that we should just make this like this. We should look at the Immutables @Styles, see https://immutables.github.io/style.html and determine based on that.
Otherwise, this just applies to everything.
Additionally, I really do not understand how this even works, the getElementName is not overridden, so I don't think that this works properly
Comment on lines
+39
to
+41
| var item = ImmutableItemDto.builder().id( "test" ).build(); | ||
|
|
||
| var target = ItemMapper.INSTANCE.map( item ); |
Member
There was a problem hiding this comment.
Please do not use var. We don't have a check for this, but I am not a fan of it and we are not using it anywhere else in our codebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test fails. I need to somehow differentiate fluent getters from other methods without parameters and with return type that are not getters. Any idea is appreciated, as I haven't been able to find a way so far... for example,
ImmutableItemDto#idmatches alsoImmutableItem.Builder#build