Skip to content

Instantly share code, notes, and snippets.

@accbel
Last active Feb 11, 2016
Embed
What would you like to do?
Lombok generic builder
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class Entity<T> {
private T body;
public static void main(String[] args) {
//Line 11 does not compile
Entity<Integer> entity = Entity.<Integer>builder().body(1).build();
System.out.println(entity.getBody());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment