Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok @Getter and @Setter unable to get or set values to object

Below is my object class:

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class MyObject {

    public Long empID;
    public String firstName;
    public String lastName;


    public MyObject(Long empID, String firstName, String lastName) {
        super();
        this.empID = empID;
        this.firstName = firstName;
        this.lastName = lastName;
    }

    @Override
    public String toString() {
        return "MyObject [empID=" + empID + ", firstName=" + firstName + ", lastName=" + lastName + "]";
    }

}

I tried to use and create an object in another class as below:

MyObject myobj = new MyObject();

After typing myObj, I don't see getEmpId() or getfirstName() as if I had written explicit getters and setters.

Kindly suggest a solution if I am missing anything here.

like image 213
Immanjunath Avatar asked Oct 16 '25 19:10

Immanjunath


1 Answers

I was able to fix this by downloading Lombok plugin from this Link and it worked.

like image 112
Immanjunath Avatar answered Oct 18 '25 08:10

Immanjunath