From a0678cedf7cd5392eb7410838edb800030182b79 Mon Sep 17 00:00:00 2001 From: dohun Date: Mon, 9 Dec 2024 18:05:25 +0900 Subject: [PATCH] =?UTF-8?q?equals,=20hashCode=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20=EB=A1=AC=EB=B3=B5=EC=9C=BC=EB=A1=9C=20=EB=8C=80?= =?UTF-8?q?=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/study/bookcafe/vo/Period.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/study/bookcafe/vo/Period.java b/src/main/java/com/study/bookcafe/vo/Period.java index a555f72..5e9879f 100644 --- a/src/main/java/com/study/bookcafe/vo/Period.java +++ b/src/main/java/com/study/bookcafe/vo/Period.java @@ -1,9 +1,10 @@ package com.study.bookcafe.vo; +import lombok.EqualsAndHashCode; import lombok.NonNull; import java.time.LocalDateTime; -import java.util.Objects; +@EqualsAndHashCode public class Period { /* - 대출 일자가 반납 일자보다 더 이전인 것을 보장할 책임 @@ -26,17 +27,4 @@ public Period(@NonNull LocalDateTime from, @NonNull LocalDateTime to) { this.from = from; this.to = to; } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - Period period = (Period) o; - return Objects.equals(from, period.from) && Objects.equals(to, period.to); - } - - @Override - public int hashCode() { - return Objects.hash(from, to); - } }