Skip to content

Instantly share code, notes, and snippets.

@accbel
Last active February 11, 2016 19:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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