1、pom
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
2、实体类
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {
private Integer id;
private String departmentName;
}
3、调用
import com.domain.Department;
public class Main1 {
public static void main(String[] args) {
}
public static void test() {
Department department = new Department();
department.setDepartmentName("222222222");
System.out.println(department);
}
}