Wednesday, April 24, 2019

Re: Immutables with RestyGWT and gwt-jackson

BTW due to https://github.com/gwtproject/gwt/issues/9612 it works only with Java8 in GWT 2.8.2

S.

On Tuesday, April 2, 2019 at 9:03:28 PM UTC+2, foal wrote:
Hi,

Spent several hours to make workable Immutables (https://immutables.github.io) objects with RestyGWT and gwt-jackson. Default approach with
@JsonSerialize(as = ImmutableVal.class)
@JsonDeserialize(as = ImmutableVal.class)

 doesn't works (gwt-jackson ignore @JsonDeserialize "as" attribute on class level) but after looking into the source code I realize that "builder" attribute is supported and works. So variant  with
@Value.Style(builder = "new") // builder has to have constructor
@JsonDeserialize(builder = ImmutableVal.Builder.class)

works.

Hope it will save somebody several hours of investigation :)

Best,
Stas


--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment