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

en/jackson/2020/11/13/jackson-builder-pattern #2

Open
utterances-bot opened this issue Feb 19, 2021 · 3 comments
Open

en/jackson/2020/11/13/jackson-builder-pattern #2

utterances-bot opened this issue Feb 19, 2021 · 3 comments

Comments

@utterances-bot
Copy link

Jackson Deserialization and the Builder Pattern - Grab Another Byte

Tutorial that shows how to use the builder pattern with Jackson for deserialization purposes. It also covers how to do it if we’re using Lombok to generate the builders. Examples included!

https://www.grabanotherbyte.com/en/jackson/2020/11/13/jackson-builder-pattern.html

Copy link

Thank you very much! This article is objective and detailed at the same time! I can't wait to use @Jacksonized when it become "official"!

Copy link

I am trying to make this work with AutoValue and have not been successful.Any insight on how to get it working with AutoValue ?

Copy link

Hey Marcos, I was reading your article and also was checking parallely. So it doesnt make any difference if constructor is private or public. The thing is it doesnt know which properties are mapped to which. Once we gave that in our constructor using @JsonProperty it works. Can you please clear this?
private Address(@JsonProperty("street") String street, @JsonProperty("zipCode")String zipCode,
@JsonProperty("city")String city, @JsonProperty("province")String province,
@JsonProperty("country")String country) {
this.street = street;
this.zipCode = zipCode;
this.city = city;
this.province = province;
this.country = country;
}
I am using like this and deserialization works for me. either i make constructor public/private

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

4 participants