Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: handle booleans more gracefully #33

Merged

Conversation

JoranVanBelle
Copy link
Contributor

Fixes #21

@JoranVanBelle JoranVanBelle force-pushed the feat/handle-booleans-more-gracefully branch 5 times, most recently from 6b559d8 to 4d6a2af Compare April 24, 2024 17:55
@@ -58,12 +59,15 @@ public List<SetterMethodDefinition> getSetterMethods() {
for (FieldDefinition field : fields) {
String name = field.name().substring(0, 1).toUpperCase() + field.name().substring(1);
methodsWithOneParam.stream()
.filter(m -> m.name().equals(field.name()))
.filter(m -> m.name().equals(field.name()) || (m.name().equals(field.name().substring(2))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see a stronger check by first verifying if the field name starts with "is" and afterwards check it for equality by stripping the first two chars.

@JoranVanBelle JoranVanBelle force-pushed the feat/handle-booleans-more-gracefully branch 4 times, most recently from 28421ef to cfc6097 Compare April 25, 2024 06:19
@JoranVanBelle JoranVanBelle force-pushed the feat/handle-booleans-more-gracefully branch 5 times, most recently from 3d6372c to 484c561 Compare April 25, 2024 06:27
@JoranVanBelle JoranVanBelle force-pushed the feat/handle-booleans-more-gracefully branch from 484c561 to 7f99bcf Compare April 25, 2024 06:33
@jonas-grgt jonas-grgt merged commit 3a8fdc3 into jonas-grgt:main Apr 25, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle boolean fields more gracefully
2 participants