Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.function.Predicate;
import lombok.Getter;
Expand Down Expand Up @@ -1014,8 +1015,24 @@ public void updateAmount(BigDecimal bigDecimal) {
this.amount = bigDecimal;
}

// TODO missing hashCode(), equals(Object obj), but probably OK as long as
// this is never stored in a Collection.
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof LoanTransaction other)) {
return false;
}
if (getId() == null || other.getId() == null) {
return false;
}
return Objects.equals(getId(), other.getId());
}

@Override
public int hashCode() {
return Objects.hash(getId());
}

public void updateTransactionDate(final LocalDate transactionDate) {
this.dateOf = transactionDate;
Expand Down