Coder Social home page Coder Social logo

lombok-examples's Introduction

Simplest maven project to test Basic features of Lombok

This is a single java project where I practiced lombok. You will find the example running commands in App.java file

Annotations covered:

1. @Getter
2. @Setter
3. @EqualsAndHashCode(of = {"sentence", "val"})
4. @ToString(exclude = "val")
5. @Builder
6. @RequiredArgsConstructor, generates a constructor for all final fields, with parameter order same as field order
7. @NoArgsConstructor creates an empty constructor.
8. @AllArgsConstructor creates a constructor for all fields

Setup for intellij

If you are using intellij, need to activate annotations processor: Settings -> Compiler -> Annotation Processors

Now install lombok plugin:

Preferences -> Plugins
Click Browse repositories...
Search for "Lombok Plugin"
Install
Restart IntelliJ

See the pom.xml file to see what line is doing what

Simple commands to try with maven

Create jar file for maven:

mvn package

Run maven project:

mvn exec:java -Dexec.mainClass="com.ayon.app.App"

Project structure:

.
β”œβ”€β”€ README.md
β”œβ”€β”€ pom.xml
└── src
    └── main
        └── java
            └── com
                └── ayon
                    β”œβ”€β”€ app
                    β”‚Β Β  └── App.java
                    β”œβ”€β”€ lombok
                    β”‚Β Β  β”œβ”€β”€ ex1
                    β”‚Β Β  β”‚Β Β  └── LombokExample.java
                    β”‚Β Β  β”œβ”€β”€ ex2
                    β”‚Β Β  β”‚Β Β  └── LombokExample2.java
                    β”‚Β Β  β”œβ”€β”€ ex3
                    β”‚Β Β  β”‚Β Β  └── LombokExample3.java
                    β”‚Β Β  β”œβ”€β”€ ex4
                    β”‚Β Β  β”‚Β Β  └── LombokExample4.java
                    β”‚Β Β  β”œβ”€β”€ ex5
                    β”‚Β Β  β”‚Β Β  └── LombokExample5.java
                    β”‚Β Β  β”œβ”€β”€ ex6
                    β”‚Β Β  β”‚Β Β  └── LombokExample6.java
                    β”‚Β Β  └── ex8
                    β”‚Β Β      └── LombokExample8.java
                    └── service
                        β”œβ”€β”€ RunningLomboks.java
                        └── RunningLomboksTest.java

lombok-examples's People

Contributors

ayonious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.