From c0aea9b5e2491e9b96f339c01b81e79d3ed14d93 Mon Sep 17 00:00:00 2001 From: coco3x Date: Fri, 6 Dec 2024 18:21:12 +0900 Subject: [PATCH] =?UTF-8?q?sytle:=20validator=20=ED=8C=A8=ED=82=A4?= =?UTF-8?q?=EC=A7=80=20=EB=B3=80=EC=88=98=20=EC=88=98=EC=A0=95=20=EB=B0=8F?= =?UTF-8?q?=20=EC=A3=BC=EC=84=9D=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/whoz_in/log_writer/common/validation/BiValidator.java | 2 +- .../log_writer/common/validation/ValidationException.java | 2 -- .../whoz_in/log_writer/common/validation/ValidationResult.java | 3 ++- .../com/whoz_in/log_writer/common/validation/Validator.java | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java index a6e859d..eadec0e 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/BiValidator.java @@ -2,7 +2,7 @@ @FunctionalInterface public interface BiValidator{ - ValidationResult getValidationResult(T t, U u); + ValidationResult getValidationResult(T target1, U target2); default void validate(T target1, U target2){ ValidationResult validationResult = getValidationResult(target1, target2); diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java index 79ce5c7..8b408f8 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationException.java @@ -1,7 +1,5 @@ package com.whoz_in.log_writer.common.validation; -import java.util.stream.Collectors; - public class ValidationException extends RuntimeException{ public ValidationException(String message) { diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java index 32519a6..9ceeaeb 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/ValidationResult.java @@ -4,7 +4,8 @@ import java.util.Collection; import java.util.List; -public class ValidationResult { +//Validator가 검증 실패한 내용을 담는 객체 +public final class ValidationResult { private final List errors; public ValidationResult() { diff --git a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java index 5c8f143..fab758e 100644 --- a/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java +++ b/modules/infrastructure/log-writer/src/main/java/com/whoz_in/log_writer/common/validation/Validator.java @@ -4,7 +4,7 @@ //검증 원인을 여러 개 담고 싶었는데, Spring Validator는 단일 객체를 대상으로 하는 필드 중심 검증이기 때문에 만듦 @FunctionalInterface public interface Validator { - ValidationResult getValidationResult(T t); + ValidationResult getValidationResult(T target); default void validate(T target){ ValidationResult validationResult = getValidationResult(target);