Enum2 Java 에 Enum Circular Dependency 이라는 말을 들어봤나요? 문제 어느 날과 다르지 않는 기능 개발 중에 이상한 상황을 마주쳤습니다. 코드부터 살펴보겠습니다. enum DisplayType { DISPLAY_1("1", ServiceType.SERVICE_A), DISPLAY_2("2", ServiceType.SERVICE_A), DISPLAY_3("3", ServiceType.SERVICE_B), DISPLAY_4("4", ServiceType.SERVICE_B); private final String name; private final ServiceType serviceType; DisplayType(String name, ServiceType serviceType) { this.name = name; this.serviceType = serviceType; .. 2023. 12. 16. 왜 Enum을 아래와같이 작성했을까? /** * Created by joenggyu0@gmail.com on 4/7/20 * Github : http://github.com/lenkim */ package net.slipp.moim.domain.model.recruit; public enum Status { BEGIN { public boolean isBegun() { return true; } }, WORKING { public boolean isWorking() { return true; } }, FINISH { public boolean isFinished() { return true; } }; public boolean isBegun() { return false; } public boolean isWorking() { return .. 2020. 7. 15. 이전 1 다음