Use Idea class entity class (with annotated @Data) the Get / Set methods given

  After today under a maven project from svn above, into Idea found some kind of entity classes will use the Set / Get method (full error), the cause of the problem is that because this entity is not a class method, similar to the code as follows:

@Data
public class Student {

    private String userName;

    private Integer age;

    public static void main(String[] args) {
        Student student = new Student();
        student.setAge(10);
        student.setUserName("张三");
    }
}

 My side of the Idea version information is as follows:

  Was a bit ignorant, what is this written? Have not used this wording, then I saw a @Data comment above, hold down the Ctrl in the comment above, write lombok saw above, what is this thing? After Baidu Internet, said lombok need to install a plug-in Idea, the process is as follows:

  Idea click on the File-Settings, and then came up with a pop-up box, select Plugins pop-up box, and then enter the search box on the right after lombok Enter, select the first result in the search out of the results, click on the following Install to install, fool installed on it.

After the installation is complete, it will become Restart Install above the words, click the button to restart the Idea, you will find the code does not restart after a mistake

Guess you like

Origin www.cnblogs.com/kawhileonardfans/p/10966897.html