From 88efaeda789c6cde864ddd5368cbe4274cac1d4c Mon Sep 17 00:00:00 2001 From: Lauren Shak Date: Mon, 8 Nov 2021 23:44:52 +0800 Subject: [PATCH] Fix Edit Command Result --- .../logic/commands/EditCommand.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/java/seedu/track2gather/logic/commands/EditCommand.java b/src/main/java/seedu/track2gather/logic/commands/EditCommand.java index 1bab8107467..00dd5caf444 100644 --- a/src/main/java/seedu/track2gather/logic/commands/EditCommand.java +++ b/src/main/java/seedu/track2gather/logic/commands/EditCommand.java @@ -63,7 +63,7 @@ public class EditCommand extends Command { + PREFIX_PHONE + "91234567 " + PREFIX_EMAIL + "johndoe@example.com"; - public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited the following fields: \n" + public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited the following fields:" + "%1$s\n" + MESSAGE_PREDICATE_SHOW_ALL_PERSONS; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; @@ -328,23 +328,23 @@ && getNextOfKinAddress().equals(e.getNextOfKinAddress()) @Override public String toString() { final StringBuilder builder = new StringBuilder(); - getName().ifPresent(n -> builder.append("; Name: ").append(n)); - getPhone().ifPresent(p -> builder.append("; Phone: ").append(p)); - getEmail().ifPresent(e -> builder.append("; Email: ").append(e)); - getCaseNumber().ifPresent(cn -> builder.append("; Case Number: ").append(cn)); - getHomeAddress().ifPresent(ha -> builder.append("; Home Address: ").append(ha)); + getName().ifPresent(n -> builder.append("\nName: ").append(n)); + getPhone().ifPresent(p -> builder.append("\nPhone: ").append(p)); + getEmail().ifPresent(e -> builder.append("\nEmail: ").append(e)); + getCaseNumber().ifPresent(cn -> builder.append("\nCase Number: ").append(cn)); + getHomeAddress().ifPresent(ha -> builder.append("\nHome Address: ").append(ha)); getWorkAddress().flatMap(wa -> wa.value) - .ifPresent(wa -> builder.append("; Work Address: ").append(wa)); + .ifPresent(wa -> builder.append("\nWork Address: ").append(wa)); getQuarantineAddress().flatMap(qa -> qa.value) - .ifPresent(qa -> builder.append("; Quarantine Address: ").append(qa)); + .ifPresent(qa -> builder.append("\nQuarantine Address: ").append(qa)); getShnPeriod().flatMap(sh -> sh.value) - .ifPresent(sh -> builder.append("; SHN Period: ").append(sh)); + .ifPresent(sh -> builder.append("\nSHN Period: ").append(sh)); getNextOfKinName().flatMap(kn -> kn.value) - .ifPresent(kn -> builder.append("; Next-of-Kin's Name: ").append(kn)); + .ifPresent(kn -> builder.append("\nNext-of-Kin's Name: ").append(kn)); getNextOfKinPhone().flatMap(kp -> kp.value) - .ifPresent(kp -> builder.append("; Next-of-Kin's Phone: ").append(kp)); + .ifPresent(kp -> builder.append("\nNext-of-Kin's Phone: ").append(kp)); getNextOfKinAddress().flatMap(ka -> ka.value) - .ifPresent(ka -> builder.append("; Next-of-Kin's Address: ").append(ka)); + .ifPresent(ka -> builder.append("\nNext-of-Kin's Address: ").append(ka)); return builder.toString(); }