1

I am using Lombok for one of my apps.

I have a class declared with the annotation @Builder. The fields are annotated with @SerializedName("xxxxx") in order to support Gson.

However, one of the fields is a List so I would like to use the @Singular annotation for them, but looks like the lib doesn't know about this annotation.

@Builder 
public class ProductForm {
   @SerializedName("title") private String title;
   @SerializedName("description") private String description;
   @SerializedName("images") private List<ImageForm> imageFormList;
   @SerializedName("active") private boolean active;
}

Does anyone know why?

Doc here

Daniele Vitali
  • 3,848
  • 8
  • 48
  • 71
  • 2
    In order to get some help, please post the complete problematic code (i.e. with imports), version of lombok used, and the error message (compile time errror?). –  Jun 16 '15 at 10:47
  • Sorry my fault. The problem was the outdated version of the lib. I updated the dependency in gradle and it works like a charm. – Daniele Vitali Jun 16 '15 at 12:32

1 Answers1

3

Using lombok 1.16.4 and your code (used @lombok.Builder not the deprecated one) I've no compile error when adding @lombok.Singular to imageFormList in your code.

So you probably forgot to import @lombok.Singular or used an old version of lombok.