diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index d07170f2d4e..acc6ebaab1b 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -115,13 +115,6 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript Medication updatedMedication = editPersonDescriptor.getMedication().orElse(personToEdit.getMedication()); Notes updatedNotes = personToEdit.getNotes(); Appointment updatedAppointment = personToEdit.getAppointment(); - /* - Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone()); - Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail()); - Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress()); - Set updatedTags = editPersonDescriptor.getTags().orElse(personToEdit.getTags()); - - */ return new Person(updatedName, updatedId, updatedWard, updatedDiagnosis, updatedMedication, updatedNotes, updatedAppointment); @@ -163,11 +156,6 @@ public static class EditPersonDescriptor { private Diagnosis diagnosis; private Medication medication; - /* - private Set tags; - - */ - public EditPersonDescriptor() {} /** @@ -180,10 +168,6 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) { setWard(toCopy.ward); setDiagnosis(toCopy.diagnosis); setMedication(toCopy.medication); - /* - setTags(toCopy.tags); - - */ } /** @@ -233,32 +217,6 @@ public Optional getMedication() { return Optional.ofNullable(medication); } - /* - /** - * Sets {@code tags} to this object's {@code tags}. - * A defensive copy of {@code tags} is used internally. - */ - /* - public void setTags(Set tags) { - this.tags = (tags != null) ? new HashSet<>(tags) : null; - } - - */ - - /* - /** - * Returns an unmodifiable tag set, which throws {@code UnsupportedOperationException} - * if modification is attempted. - * Returns {@code Optional#empty()} if {@code tags} is null. - */ - /* - public Optional> getTags() { - return (tags != null) ? Optional.of(Collections.unmodifiableSet(tags)) : Optional.empty(); - } - - */ - - @Override public boolean equals(Object other) { if (other == this) { @@ -276,13 +234,6 @@ public boolean equals(Object other) { && Objects.equals(ward, otherEditPersonDescriptor.ward) && Objects.equals(diagnosis, otherEditPersonDescriptor.diagnosis) && Objects.equals(medication, otherEditPersonDescriptor.medication); - /* - && Objects.equals(phone, otherEditPersonDescriptor.phone) - && Objects.equals(email, otherEditPersonDescriptor.email) - && Objects.equals(address, otherEditPersonDescriptor.address) - && Objects.equals(tags, otherEditPersonDescriptor.tags); - - */ } @Override @@ -293,13 +244,6 @@ public String toString() { .add("ward", ward) .add("diagnosis", diagnosis) .add("medication", medication) - /* - .add("phone", phone) - .add("email", email) - .add("address", address) - .add("tags", tags) - - */ .toString(); } } diff --git a/src/main/java/seedu/address/logic/commands/ListCommand.java b/src/main/java/seedu/address/logic/commands/ListCommand.java index 84be6ad2596..8e040763bb4 100644 --- a/src/main/java/seedu/address/logic/commands/ListCommand.java +++ b/src/main/java/seedu/address/logic/commands/ListCommand.java @@ -14,7 +14,6 @@ public class ListCommand extends Command { public static final String MESSAGE_SUCCESS = "Listed all persons"; - @Override public CommandResult execute(Model model) { requireNonNull(model); diff --git a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java index 55f9b571b10..2e63c39802a 100644 --- a/src/test/java/seedu/address/logic/commands/CommandTestUtil.java +++ b/src/test/java/seedu/address/logic/commands/CommandTestUtil.java @@ -34,11 +34,9 @@ public class CommandTestUtil { public static final String VALID_NAME_AMY = "Amy Bee"; public static final String VALID_NAME_BOB = "Bob Choo"; public static final String VALID_ID_AMY = "P12345"; - public static final String VALID_ID_WITH_SPECIAL_CHAR_AMY = "P12345/"; public static final String VALID_ID_BOB = "P54321"; public static final String VALID_ID_WITH_SPECIAL_CHAR_BOB = "P54321/"; public static final String VALID_WARD_AMY = "A1"; - public static final String VALID_WARD_WITH_SPECIAL_CHAR_AMY = "A1!"; public static final String VALID_WARD_BOB = "B3"; public static final String VALID_WARD_WITH_SPECIAL_CHAR_BOB = "B3!"; public static final String VALID_DIAGNOSIS_AMY = "Celiac Disease"; @@ -62,20 +60,6 @@ public class CommandTestUtil { public static final String APPOINTMENT_DESC_AMY = " " + PREFIX_APPOINTMENT + VALID_APPOINTMENT_AMY; public static final String APPOINTMENT_DESC_BOB = " " + PREFIX_APPOINTMENT + VALID_APPOINTMENT_BOB; - - - /* - public static final String VALID_PHONE_AMY = "11111111"; - public static final String VALID_PHONE_BOB = "22222222"; - public static final String VALID_EMAIL_AMY = "amy@example.com"; - public static final String VALID_EMAIL_BOB = "bob@example.com"; - public static final String VALID_ADDRESS_AMY = "Block 312, Amy Street 1"; - public static final String VALID_ADDRESS_BOB = "Block 123, Bobby Street 3"; - public static final String VALID_TAG_HUSBAND = "husband"; - public static final String VALID_TAG_FRIEND = "friend"; - - */ - public static final String NAME_DESC_AMY = " " + PREFIX_NAME + VALID_NAME_AMY; public static final String NAME_DESC_BOB = " " + PREFIX_NAME + VALID_NAME_BOB; public static final String ID_DESC_AMY = " " + PREFIX_ID + VALID_ID_AMY; @@ -86,22 +70,17 @@ public class CommandTestUtil { public static final String DIAGNOSIS_DESC_BOB = " " + PREFIX_DIAGNOSIS + VALID_DIAGNOSIS_BOB; public static final String MEDICATION_DESC_AMY = " " + PREFIX_MEDICATION + VALID_MEDICATION_AMY; public static final String MEDICATION_DESC_BOB = " " + PREFIX_MEDICATION + VALID_MEDICATION_BOB; - public static final String INVALID_NAME_DESC = " " + PREFIX_NAME + "James&"; // '&' not allowed in names public static final String INVALID_ID_DESC = " " + PREFIX_ID + "P12D^5"; // '^' not allowed in id public static final String INVALID_WARD_DESC = " " + PREFIX_WARD + ""; // No empty string allowed public static final String INVALID_DIAGNOSIS_DESC = " " + PREFIX_DIAGNOSIS + "$<>"; // Only a-z and .()/- allowed public static final String INVALID_MEDICATION_DESC = " " + PREFIX_MEDICATION + "$<>"; // Only a-z and .()/- allowed - // Only a-z and .()/- allowed public static final String INVALID_APPOINTMENT_DESC = " " + PREFIX_APPOINTMENT + "\t"; public static final String INVALID_START_DATETIME = "10/11/2024"; // Only 0-9 and - allowed public static final String INVALID_END_DATETIME = "10-11-202?"; // Only 0-9 and - allowed public static final String INVALID_START_DATETIME_DESC = " " + PREFIX_START + INVALID_START_DATETIME; public static final String INVALID_END_DATETIME_DESC = " " + PREFIX_END + INVALID_END_DATETIME; - - - public static final String PREAMBLE_WHITESPACE = "\t \r \n"; public static final String PREAMBLE_NON_EMPTY = "NonEmptyPreamble"; diff --git a/src/test/java/seedu/address/logic/commands/EditPersonDescriptorTest.java b/src/test/java/seedu/address/logic/commands/EditPersonDescriptorTest.java index 9de5f081e44..fdf86a50624 100644 --- a/src/test/java/seedu/address/logic/commands/EditPersonDescriptorTest.java +++ b/src/test/java/seedu/address/logic/commands/EditPersonDescriptorTest.java @@ -55,25 +55,6 @@ public void equals() { // different medication -> returns false editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withMedication(VALID_MEDICATION_BOB).build(); assertFalse(DESC_AMY.equals(editedAmy)); - - /* - // different phone -> returns false - editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withPhone(VALID_PHONE_BOB).build(); - assertFalse(DESC_AMY.equals(editedAmy)); - - // different email -> returns false - editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withEmail(VALID_EMAIL_BOB).build(); - assertFalse(DESC_AMY.equals(editedAmy)); - - // different address -> returns false - editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withAddress(VALID_ADDRESS_BOB).build(); - assertFalse(DESC_AMY.equals(editedAmy)); - - // different tags -> returns false - editedAmy = new EditPersonDescriptorBuilder(DESC_AMY).withTags(VALID_TAG_HUSBAND).build(); - assertFalse(DESC_AMY.equals(editedAmy)); - - */ } @Test