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

Suggested change to hasXxx implementation #5

Open
cptully opened this issue Jan 19, 2022 · 1 comment
Open

Suggested change to hasXxx implementation #5

cptully opened this issue Jan 19, 2022 · 1 comment

Comments

@cptully
Copy link

cptully commented Jan 19, 2022

I forked your project, intending to make this change myself for something at work but I cannot seem to pull all of the dependencies when behind my corporate firewall... I will have to try on my personal computer this weekend.

We use HAPI FHIR and they have a more robust implementation of hasXxxx() that you may find interesting:

public boolean hasXxxx() { return this.xxxx != null && !this.xxxx.isEmpty(); }

@kokorin
Copy link
Owner

kokorin commented Jan 28, 2022

Sorry for very late reply.

Main goal for this project was to generate MapStruct presence checkers for partial update REST requests.
With such requests null values must not be treated as absent values. Absent values doesn't cause update, but null values in DTO causes Entity field to be set to null.

Another issue is that not every type has isEmpty() method.

Actually this project is mainly for academical purpose, I had an interest in hacking Lombok. So feel free to use it as ground for your own Lombok plugin.

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

No branches or pull requests

2 participants