From 8784aecc3bac1e507483d6f5eade827ea40a7507 Mon Sep 17 00:00:00 2001 From: Christopher Tan Date: Thu, 10 Oct 2024 23:21:06 +0800 Subject: [PATCH] Edit method header comments --- .../java/seedu/address/model/person/Person.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/seedu/address/model/person/Person.java b/src/main/java/seedu/address/model/person/Person.java index 8227faa2113..201bebd315d 100644 --- a/src/main/java/seedu/address/model/person/Person.java +++ b/src/main/java/seedu/address/model/person/Person.java @@ -75,25 +75,29 @@ public boolean isSamePerson(Person otherPerson) { } /** - * Returns true if both person have the same email address. - * This is to check for duplicates in emails in the contact list. + * Checks for duplicates in emails in the contact list. + * @param otherPerson The Person object to compare against. + * @return True if both persons have the same email address. */ public boolean hasSameEmail(Person otherPerson) { return otherPerson != null && otherPerson.getEmail().equals(this.getEmail()); } /** - * Returns true if two contacts share the same phone number. * Checks for duplicates in phone numbers in the contact list. + * @param otherPerson The Person object to compare against. + * @return True if both persons have the same phone number. */ public boolean hasSamePhoneNumber(Person otherPerson) { return otherPerson != null && otherPerson.getPhone().equals(this.getPhone()); } /** - * Returns true if two contacts are considered as duplicates. - * This is to avoid adding duplicate contact in the contact list. - * + * Checks for duplicated contact information between Person instances. + * This is to avoid adding duplicate contacts in the contact list. + * Checked fields: name, phone, email. + * @param otherPerson The Person object to compare against. + * @return True if two contacts are considered as duplicates. */ public boolean hasDuplicateInfo(Person otherPerson) { return this.isSamePerson(otherPerson)