Slide 1

Slide 1 text

Lombok Eric Lefevre-Ardant @elefevre

Slide 2

Slide 2 text

@elefevre http://ericlefevre.net/ elefevre@palo-it.com Eric Lefevre-Ardant

Slide 3

Slide 3 text

http://brownbaglunch.asia/ “Will Speak For Food” Brown Bag Lunch Singapore

Slide 4

Slide 4 text

Lombok

Slide 5

Slide 5 text

Demo https://www.flickr.com/photos/davidchief/518037785/

Slide 6

Slide 6 text

From this... Reduced boiler-plate code

Slide 7

Slide 7 text

From this... Reduced boiler-plate code to this...

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

How to make it work

Slide 10

Slide 10 text

Add lombok.jar to your classpath ...with Maven: org.projectlombok lombok 1.16.2 provided How to make it work

Slide 11

Slide 11 text

Also, plugins ● Eclipse ● NetBeans ● IDEA IntelliJ How to make it work

Slide 12

Slide 12 text

Features

Slide 13

Slide 13 text

@Data Features

Slide 14

Slide 14 text

@Data and friends ● @Getter & @Setter ● @ToString ● @EqualsAndHashCode ● @NoArgsConstructor ● @RequiredArgsConstructor ● @AllArgsConstructor Features

Slide 15

Slide 15 text

@Data and friends ● @Getter & @Setter ● @ToString ● @EqualsAndHashCode ● @NoArgsConstructor ● @RequiredArgsConstructor ● @AllArgsConstructor Features And... @Value

Slide 16

Slide 16 text

Demo https://www.flickr.com/photos/myprofe/2255453988/

Slide 17

Slide 17 text

Under the hood

Slide 18

Slide 18 text

● Annotation Processor ● Injects code into the AST at compilation time Under the hood

Slide 19

Slide 19 text

Demo https://www.flickr.com/photos/freefoto/3556983909/

Slide 20

Slide 20 text

Any performance impact?

Slide 21

Slide 21 text

No Any performance impact?

Slide 22

Slide 22 text

@NonNull @Builder @SneakyThrows @Log4j, @Slf4j... @Synchronized Other features

Slide 23

Slide 23 text

@Wither (experimental) @Delegate (experimental) And more!

Slide 24

Slide 24 text

● Easy to implement ● Easy to remove ● No performance impact To sum up

Slide 25

Slide 25 text

Questions? http://projectlombok.org/ ● Easy to implement ● Easy to remove ● No performance impact

Slide 26

Slide 26 text

Creative Commons License These slides are made available under the Creative Commons Attribution License. You may share, modify this document as much as you wish, as long as you give attribution to me. For example, include a link to http://ericlefevre.net/ somewhere. To the best of my knowledge, all the pictures included were also released under this same license. Links to originals are included. Details on the license: http://creativecommons.org/licenses/by/3.0/