Skip to content

Commit

Permalink
Fix Edit Command Result
Browse files Browse the repository at this point in the history
  • Loading branch information
lrnshk committed Nov 8, 2021
1 parent 64bd569 commit 88efaed
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/main/java/seedu/track2gather/logic/commands/EditCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class EditCommand extends Command {
+ PREFIX_PHONE + "91234567 "
+ PREFIX_EMAIL + "[email protected]";

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.";
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 88efaed

Please sign in to comment.