Skip to content

Commit

Permalink
equals, hashCode 메서드 롬복으로 대체
Browse files Browse the repository at this point in the history
  • Loading branch information
shine-17 committed Dec 9, 2024
1 parent 5b1449d commit a0678ce
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/main/java/com/study/bookcafe/vo/Period.java
Original file line number Diff line number Diff line change
@@ -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 {
/*
- 대출 일자가 반납 일자보다 더 이전인 것을 보장할 책임
Expand All @@ -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);
}
}

0 comments on commit a0678ce

Please sign in to comment.