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: add setter and NoArgsConstructor lombok to DruidFilters #92

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

qiangmao
Copy link

add setter and NoArgsConstructor to DruidFilters, for jackson
deserialize DruidFilters from origin json

  add setter and NoArgsConstructor to DruidFilters, for jackson
deserialize DruidFilters from origin json
@abhi-zapr
Copy link
Contributor

Hey @qiangmao

I don't see the point of Setter and NoArgsConstructors. In every filter at least one of the field is required/nonNull hence no need for NoArgsConstructor. We can keep nonNull checks on constructors with required arguments. In some filter where many fields are optional we have builders which is convenient way than NoArgsConstructor and setters combination.

Thanks.

@abhi-zapr abhi-zapr self-assigned this May 26, 2019
@qiangmao
Copy link
Author

Hey, I need to deserialization from JSON(which store in database) with Jackson, Jackson needs a default no arguments Constructors.

@abhi-zapr
Copy link
Contributor

abhi-zapr commented Jun 15, 2019

Hey @qiangmao
Ok, for your use case it make sense to have this NoArgsConstructor in filters.
But how are you handling Polymorphic serialization and deserialization ? Are you using global default typing ? And do we require setters ? Because I was able to serialize and deserialize with global default typing, NoArgsConstructor and Getter.

On side note : With some code overhead you can achieve this using combination of Jackson's MixIn and Creator Feature.

@GG-Zapr does it makes sense to have NoArgsConstructor in filters or any other query formation classes for this serialization and deserialization use case ?

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.

2 participants