티스토리 뷰

Lombok 적용 전

package com.example.demo.model;

public class Friend {
    private String id;
    private String name;

    public Friend(String id, String name) 
    {
		this.id = id;
        this.name = name;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
}

Lombok 적용 후

package com.example.demo.model;

// import lombok.AllArgsConstructor;
import lombok.Getter;
// import lombok.NoArgsConstructor;
import lombok.Setter;
// import lombok.ToString;

@Getter
@Setter
// @ToString
// @NoArgsConstructor
// @AllArgsConstructor


public class FriendwithLombok {
    private String id;
    private String name;
    private Void getId;
    private Void getName;
    private Void setId;
    private Void setName;

    public FriendwithLombok(String id, String name) 
    {
		this.id = id;
        this.name = name;
	}
}

 

@Getter

 

@Setter

 

@ToString


@NoArgsConstructor


@AllArgsConstructor