From de88f128142de29d8dafe26f086b702f58658ea8 Mon Sep 17 00:00:00 2001 From: Teoh Tze Tzun Date: Mon, 1 Apr 2024 20:49:27 +0800 Subject: [PATCH] Loan.java: Add assert statements --- src/main/java/seedu/address/model/person/Loan.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/seedu/address/model/person/Loan.java b/src/main/java/seedu/address/model/person/Loan.java index fca69147eba..446edf6d101 100644 --- a/src/main/java/seedu/address/model/person/Loan.java +++ b/src/main/java/seedu/address/model/person/Loan.java @@ -35,6 +35,8 @@ public class Loan implements Comparable { */ public Loan(int id, float value, Date startDate, Date returnDate, Person assignee) { requireAllNonNull(id, value, startDate, returnDate, assignee); + assert isValidValue(value); + assert id >= 0; this.id = id; this.value = value; this.startDate = startDate; @@ -55,6 +57,8 @@ public Loan(int id, float value, Date startDate, Date returnDate, Person assigne */ public Loan(int id, float value, Date startDate, Date returnDate, boolean isReturned, Person assignee) { requireAllNonNull(id, value, startDate, returnDate, isReturned, assignee); + assert isValidValue(value); + assert id >= 0; this.id = id; this.value = value; this.startDate = startDate;