Skip to content

Commit

Permalink
sytle: validator 패키지 변수 수정 및 주석 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
inferior3x committed Dec 6, 2024
1 parent 155f9d3 commit c0aea9b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@FunctionalInterface
public interface BiValidator<T, U>{
ValidationResult getValidationResult(T t, U u);
ValidationResult getValidationResult(T target1, U target2);

default void validate(T target1, U target2){
ValidationResult validationResult = getValidationResult(target1, target2);
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import java.util.Collection;
import java.util.List;

public class ValidationResult {
//Validator가 검증 실패한 내용을 담는 객체
public final class ValidationResult {
private final List<String> errors;

public ValidationResult() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//검증 원인을 여러 개 담고 싶었는데, Spring Validator는 단일 객체를 대상으로 하는 필드 중심 검증이기 때문에 만듦
@FunctionalInterface
public interface Validator<T> {
ValidationResult getValidationResult(T t);
ValidationResult getValidationResult(T target);

default void validate(T target){
ValidationResult validationResult = getValidationResult(target);
Expand Down

0 comments on commit c0aea9b

Please sign in to comment.