Skip to content

[item2] @Builder에 필수 값 지정을 할 방법이 없을까요? #7

Open

Description

@jun108059

아이템 2. 생성자에 매개변수가 많다면 빌더를 고려하라

Builder 패턴은 많은 장점이 있지만 필수 값을 지정할 수 없다는 큰 단점이 존재합니다.

필수 값을 포함할 수 있는 좋은 방법이 없을까요?

Activity

  1. added this to the chapter2 milestone on Sep 7, 2022
  2. youngreal commented on Sep 8, 2022

    @youngreal
    Member

    롬복 1.16.16 버전부터는 @Builder.Default 라는걸로도 기본값 지정이 가능하다고 하긴 하네요
    https://projectlombok.org/features/Builder
    https://tomining.tistory.com/180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions