springboot use @data plug, reduce code

A, idea to install the plug-lombok

 

 Second, the idea restart

Third, add dependencies

<dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
</dependency>

Fourth, the test

Creating an entity class

import lombok.Data;

@Data
public class User {
    
    private String name;
}

test

 

Guess you like

Origin www.cnblogs.com/BeenTogether/p/11621610.html