From ac07af631ef41e773f47acb75c76a98b7ddfe8e3 Mon Sep 17 00:00:00 2001 From: teddy Date: Fri, 28 Nov 2025 10:35:31 +0900 Subject: [PATCH] =?UTF-8?q?class=20name=20enum=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/dto/DetectionClassification.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/com/kamco/cd/kamcoback/common/dto/DetectionClassification.java diff --git a/src/main/java/com/kamco/cd/kamcoback/common/dto/DetectionClassification.java b/src/main/java/com/kamco/cd/kamcoback/common/dto/DetectionClassification.java new file mode 100644 index 00000000..fdf5fac9 --- /dev/null +++ b/src/main/java/com/kamco/cd/kamcoback/common/dto/DetectionClassification.java @@ -0,0 +1,44 @@ +package com.kamco.cd.kamcoback.common.dto; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum DetectionClassification { + BUILDING("building", "빌딩"), + CONTAINER("container", "컨테이너(창고·적재함)"), + FIELD("field", "경작지 / 들판"), + FOREST("forest", "숲"), + GRASS("grass", "초지 / 잔디지역"), + GREENHOUSE("greenhouse", "비닐하우스"), + LAND("land", "나지"), + ORCHARD("orchard", "과수원"), + ROAD("road", "도로"), + STONE("stone", "암석 / 돌 지역"), + TANK("tank", "탱크(저유탱크 등 저장시설)"), + TUMULUS("tumulus", "고분(무덤)"), + WASTE("waste", "폐기물 적치장 / 황폐지"), + WATER("water", "수체(水域) / 물"), + ETC("ETC", "기타"); // For 'etc' (miscellaneous/other) + + private final String id; + private final String desc; + + + /** + * Optional: Helper method to get the enum from a String, case-insensitive, or return ETC if not found. + */ + public static DetectionClassification fromString(String text) { + if (text == null || text.trim().isEmpty()) { + return ETC; + } + + try { + return DetectionClassification.valueOf(text.toUpperCase()); + } catch (IllegalArgumentException e) { + // If the string doesn't match any enum constant name, return ETC + return ETC; + } + } +}