SlideShare a Scribd company logo
Project Lombok!
Problems of the Industry
 Boiler Plate Code
  Syntax Verbosity
 Non Standardization
  Not following the standard code conventions!!
 Human Error/Dependency
  Repeatable things (defining Getters, Setters etc.)
Demo Video

 Taken from http://projectlombok.org/

 Gives an idea what Project Lombok is and how it
 can be installed.

 Simple Demo of few Features.
Features
@Getter, @Setter, @ToString, @EqualsAndHashCode, @Data
@NoArgsConstructor, @RequiredArgsConstructor and
@AllArgsConstructor
@Cleanup, @Synchronized
@Log
@Delegate
val
@Getter and @Setter
 Automatic Generation of getters and setters.
 Method will be public unless you explicitly specify an
 AccessLevel
 @Getter and/or @Setter annotation on class
 Disable getter/setter generation for any field by using
 the special AccessLevel.NONE
 @NotNull for nullity check
 Demo
@ToString
Generates a default implementation of the toString()
method

Parameters 




Demo
@EqualsAndHashCode
Generates hashCode and equals implementations from
the fields (non-static, non-transient)

Parameters 




Demo
Constructor level Annotations

@NoArgsConstructor, @RequiredArgsConstructor, @AllA
rgsConstructor

Generates constructors that take no arguments, one
argument per final / non-null field, or one argument for
every field.

Specialized constructor can be made. Compile-time error
in case of any conflicts.

Demo
@Data
All together now: A shortcut for
@ToString, @EqualsAndHashCode, @Getter on all
fields, @Setter on all non-final fields, and
@RequiredArgsConstructor

Included annotations with changed parameters can be
defined along with @Data
@Cleanup
Automatic resource management: Call your close() methods
safely with no hassle.
Example: @Cleanup InputStream in = new
FileInputStream("some/file");
If the type of object you'd like to cleanup does not have a
close() method, but some other no-argument method like
dispose() so write it as
@Cleanup("dispose") TestClass t = new TestClass();
Logger Annotations!
Generate a logger field with name “log”

Four options
 @CommonsLog
 @Log
 @Log4j
 @Slf4j
And Lot More!!!
Some other supported features like
@Delegate, @Synchronized, val etc.

More to come soon!

Open Source

Details can be found at http://projectlombok.org/

More Related Content

PPTX
PPTX
reactJS
PPTX
Implementing DDD with C#
PDF
An Introduction to Redux
PDF
Formation Spring Avancé gratuite par Ippon 2014
PPTX
[Final] ReactJS presentation
PDF
TypeScript: coding JavaScript without the pain
PPTX
Introduction to React JS for beginners
reactJS
Implementing DDD with C#
An Introduction to Redux
Formation Spring Avancé gratuite par Ippon 2014
[Final] ReactJS presentation
TypeScript: coding JavaScript without the pain
Introduction to React JS for beginners

What's hot (20)

PPTX
Spring boot - an introduction
PDF
An introduction to React.js
PPTX
Introducing Swagger
PPTX
React Hooks
ODP
Introduction to ReactJS
PDF
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
PPTX
Test Driven Development (TDD) Preso 360|Flex 2010
PPT
Spring data presentation
PPTX
React JS: A Secret Preview
PPTX
React hooks
PPTX
WEB SERVICE SOAP, JAVA, XML, JAXWS
PDF
Introduction to React Hooks
PPTX
Understanding react hooks
PPT
Javascript arrays
PDF
Rediscovering Spring with Spring Boot(1)
PPTX
React workshop presentation
PDF
Spring Boot
PPTX
Presentation on "An Introduction to ReactJS"
PDF
Redux Toolkit - Quick Intro - 2022
PPT
exception handling in java.ppt
Spring boot - an introduction
An introduction to React.js
Introducing Swagger
React Hooks
Introduction to ReactJS
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Test Driven Development (TDD) Preso 360|Flex 2010
Spring data presentation
React JS: A Secret Preview
React hooks
WEB SERVICE SOAP, JAVA, XML, JAXWS
Introduction to React Hooks
Understanding react hooks
Javascript arrays
Rediscovering Spring with Spring Boot(1)
React workshop presentation
Spring Boot
Presentation on "An Introduction to ReactJS"
Redux Toolkit - Quick Intro - 2022
exception handling in java.ppt
Ad

Viewers also liked (14)

PDF
Lombok ハンズオン
PDF
Lombok island-Indonesia
PDF
Lombokのススメ
PPTX
阿里自研数据库 Ocean base实践
PPT
Wicket体験談
KEY
Wicket 2010
PDF
Java初心者がJava8のラムダ式をやってみた
PDF
Spring bootでweb セキュリティ(ログイン認証)編
PDF
社内Java8勉強会 ラムダ式とストリームAPI
PPTX
High and low context cultures relationships in each
PDF
入門Ansible
PDF
ほんとうに便利だった業務で使えるJava SE8新機能(JJUG CCC 2015 Spring)
PDF
こわくない Git
PDF
いつやるの?Git入門
Lombok ハンズオン
Lombok island-Indonesia
Lombokのススメ
阿里自研数据库 Ocean base实践
Wicket体験談
Wicket 2010
Java初心者がJava8のラムダ式をやってみた
Spring bootでweb セキュリティ(ログイン認証)編
社内Java8勉強会 ラムダ式とストリームAPI
High and low context cultures relationships in each
入門Ansible
ほんとうに便利だった業務で使えるJava SE8新機能(JJUG CCC 2015 Spring)
こわくない Git
いつやるの?Git入門
Ad

Similar to Project Lombok! (20)

PPSX
Writing code that writes code - Nguyen Luong
PPSX
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
PDF
Lombok Features
PDF
Java 23 and Beyond - A Roadmap Of Innovations
PDF
Hacking Java - Enhancing Java Code at Build or Runtime
PDF
Rocket Propelled Java - Devoxx12
PPTX
Java 8 and beyond, a scala story
PPTX
Hacking Java @JavaLand2016
PPTX
Software Uni Conf October 2014
PDF
New Java features: Simplified Design Patterns[LIT3826]
PDF
Writing clean code with Java 9+
PDF
Voxxed Athens 2018 - Clean Code with Java9+
PDF
Java Full Stack course in hyderabad
PDF
Core Java Volume I Fundamentals 12th Horstmann Cay
PDF
Lombokの紹介
PDF
Master class in modern Java
PDF
Little Did He Know ...
PDF
API Design
PDF
Java full stack pdf.pdf
PDF
Deep Dive in Java 9+
Writing code that writes code - Nguyen Luong
TechkTalk #12 Grokking: Writing code that writes code – Nguyen Luong
Lombok Features
Java 23 and Beyond - A Roadmap Of Innovations
Hacking Java - Enhancing Java Code at Build or Runtime
Rocket Propelled Java - Devoxx12
Java 8 and beyond, a scala story
Hacking Java @JavaLand2016
Software Uni Conf October 2014
New Java features: Simplified Design Patterns[LIT3826]
Writing clean code with Java 9+
Voxxed Athens 2018 - Clean Code with Java9+
Java Full Stack course in hyderabad
Core Java Volume I Fundamentals 12th Horstmann Cay
Lombokの紹介
Master class in modern Java
Little Did He Know ...
API Design
Java full stack pdf.pdf
Deep Dive in Java 9+

Recently uploaded (20)

PDF
project resource management chapter-09.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Mushroom cultivation and it's methods.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
August Patch Tuesday
PPTX
Tartificialntelligence_presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
A Presentation on Touch Screen Technology
PPTX
1. Introduction to Computer Programming.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
TLE Review Electricity (Electricity).pptx
project resource management chapter-09.pdf
Approach and Philosophy of On baking technology
Heart disease approach using modified random forest and particle swarm optimi...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Mushroom cultivation and it's methods.pdf
OMC Textile Division Presentation 2021.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
August Patch Tuesday
Tartificialntelligence_presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Group 1 Presentation -Planning and Decision Making .pptx
A Presentation on Touch Screen Technology
1. Introduction to Computer Programming.pptx
MIND Revenue Release Quarter 2 2025 Press Release
TLE Review Electricity (Electricity).pptx

Project Lombok!

  • 2. Problems of the Industry Boiler Plate Code Syntax Verbosity Non Standardization Not following the standard code conventions!! Human Error/Dependency Repeatable things (defining Getters, Setters etc.)
  • 3. Demo Video Taken from http://projectlombok.org/ Gives an idea what Project Lombok is and how it can be installed. Simple Demo of few Features.
  • 4. Features @Getter, @Setter, @ToString, @EqualsAndHashCode, @Data @NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor @Cleanup, @Synchronized @Log @Delegate val
  • 5. @Getter and @Setter Automatic Generation of getters and setters. Method will be public unless you explicitly specify an AccessLevel @Getter and/or @Setter annotation on class Disable getter/setter generation for any field by using the special AccessLevel.NONE @NotNull for nullity check Demo
  • 6. @ToString Generates a default implementation of the toString() method Parameters  Demo
  • 7. @EqualsAndHashCode Generates hashCode and equals implementations from the fields (non-static, non-transient) Parameters  Demo
  • 8. Constructor level Annotations @NoArgsConstructor, @RequiredArgsConstructor, @AllA rgsConstructor Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field. Specialized constructor can be made. Compile-time error in case of any conflicts. Demo
  • 9. @Data All together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, @Setter on all non-final fields, and @RequiredArgsConstructor Included annotations with changed parameters can be defined along with @Data
  • 10. @Cleanup Automatic resource management: Call your close() methods safely with no hassle. Example: @Cleanup InputStream in = new FileInputStream("some/file"); If the type of object you'd like to cleanup does not have a close() method, but some other no-argument method like dispose() so write it as @Cleanup("dispose") TestClass t = new TestClass();
  • 11. Logger Annotations! Generate a logger field with name “log” Four options @CommonsLog @Log @Log4j @Slf4j
  • 12. And Lot More!!! Some other supported features like @Delegate, @Synchronized, val etc. More to come soon! Open Source Details can be found at http://projectlombok.org/

Editor's Notes

  • #5: @Getter / @SetterNever write public intgetFoo() {return foo;} again.@ToStringNo need to start a debugger to see your fields: Just let lombok generate a toString for you!@EqualsAndHashCodeEquality made easy: Generates hashCode and equals implementations from the fields of your object.@DataAll together now: A shortcut for @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields, and @RequiredArgsConstructor!@NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructorConstructors made to order: Generates constructors that take no arguments, one argument per final / non-null field, or one argument for every field.@CleanupAutomatic resource management: Call your close() methods safely with no hassle.@Synchronizedsynchronized done right: Don't expose your locks.@LogCaptain's Log, stardate 24435.7: "What was that line again?"@DelegateDon't lose your composition.valFinally! Hassle-free final local variables.