<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
<scope>provided</scope>
</dependency>
추가
@Getter
@Setter
@ToString
@Data
//@Getter + @Setter + @ToString
@AllArgsConstructor
//일반생성자
@NoArgsConstructor
//기본생성자
@Builder
//setter의 장점 + 생성자의 장점, .build() 할 때까지 생성자를 뱉지 않는다.
public class MemberVo {
private String id;
private String pwd;
private String name;
}
->
.build()
할 때까지 생성자를 뱉지 않는다.package com.kh.app18;
import org.junit.Test;
import com.kh.app18.member.vo.MemberVo;
public class MyClass {
@Test
public void test01() {
System.out.println("test01 called...");
MemberVo m = new MemberVo();
m.setId("lsy");
String id = m.getId();
System.out.println("id: " + id);
MemberVo mv = new MemberVo("lsy", "1234", "Helloffice");
System.out.println("mv: " + mv);
}
}
->