Lombok not generating getter and setter?

Ryuu

First time using lombok, and if I'm understanding it correctly, lomboks getter and setter annotations generates setter and getter methods without having to code it, but for some reason I'm getting an "undefined method" error whenever I try to call a getter/setter method.

What's wrong here?

import lombok.Getter;
import lombok.Setter;

public class Student {
    @Getter @Setter
    private String firstName;
    @Getter @Setter
    private String lastName;
    
    public Student(String firstName, String lastName) {
        super();
        this.setFirstName(firstName); // method undefined error here
        this.setLastName(lastName);   // method undefined error here
    }
}
Clint Magnus

Your code sould work as this, Did you install lombok's plugin on your EDI ?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Lombok is not generating getter and setter

Omitting one Setter/Getter in Lombok

Javadoc not generated for Lombok getter and setter

Find usages of lombok generated getter/setter in Intellij

Lombok getter/setter vs Java 14 record

Eclipse with Lombok - search for getter and setter usages

Java getter/setter generation with Lombok for code with annotations

How to invoke getter and setter method for lombok in java?

Maintain naming standard for variables with Lombok @Getter AND @Setter

gradle 6.4 build with lombok 1.18.12 not generating getters and setter

Is there anyway in Idea to recognize a getter/setter generated by lombok in the same module

Lombok does not create getter and setter methods after using @Data

mvn install produces compilation error for @Getter @Setter properties for Lombok properties

Lombok @Getter and @Setter annotations are not being recognised when getAnnoations() method is used

Is there a way of generating getter, setter functions in visual studio 2012 like in eclipse

Generating Javascript class with constructor, getter and setter from Json Schema

Getter and Setter?

How to turn off getter/setter only for one instance non-final field? [Project Lombok]

Overload lombok setter

Lombok @Getter and copies of Collections

Lombok - access to getter not visible

SonarQube Lombok Getter recognition

How to create getter and setter

Getter is not present for class setter ***

Dynamic Property Getter and Setter

Can not find @Getter and @Setter

ConfigurationProperties not working with @Getter and @Setter

Custom setter but auto getter

Javascript overload getter and setter