Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Person: update result message
Browse files Browse the repository at this point in the history
There are no delimiters between each field entered and an additional
phrase 'Tags:' is always present even if the user did not input any
tags.

As a result, the result message is not as user-friendly.

Let's add delimiters and remove 'Tags:' from the result message if tags
are not present.
  • Loading branch information
jonahtanjz committed Dec 7, 2020
1 parent 6071829 commit 20e1f7f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/seedu/address/model/person/Person.java
Expand Up @@ -106,13 +106,16 @@ public int hashCode() {
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append(getName())
.append(" Phone: ")
.append("; Phone: ")
.append(getPhone())
.append(" Email: ")
.append("; Email: ")
.append(getEmail())
.append(" Address: ")
.append(getAddress())
.append(" Tags: ");
.append("; Address: ")
.append(getAddress());

if (getTags().size() > 0) {
builder.append("; Tags: ");
}
getTags().forEach(builder::append);
return builder.toString();
}
Expand Down

0 comments on commit 20e1f7f

Please sign in to comment.