From c21adf7f47ed0077c53547a36041b1dba45bdcb8 Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot
+ You can customize parts of your builder, for example adding another method to the builder class, or annotating a method in the builder class, by making the builder class yourself. Lombok will generate everything that you do not manually add, and put it into this builder class. For example, if you are trying to configure jackson to use a specific subtype for a collection, you can write something like:
+@Value @Builder +@JsonDeserialize(builder = JacksonExample.JacksonExampleBuilder.class) +public class JacksonExample { + @Singular private List<Foo> foos; + + @JsonPOJOBuilder(withPrefix = "") + public static class JacksonExampleBuilder implements JacksonExampleBuilderMeta { + } + + private interface JacksonExampleBuilderMeta { + @JsonDeserialize(contentAs = FooImpl.class) JacksonExampleBuilder foos(List<? extends Foo> foos) + } +} +