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

Commit

Permalink
Person: Remove 'Tags: ' if there are no tags
Browse files Browse the repository at this point in the history
An additional phrase 'Tags:' is always present even if the user did
not input any tags.

This is not intuitive as the result message is displaying
unnecessary information.

Let's remove 'Tags:' from the result message if tags are not present.
  • Loading branch information
jonahtanjz committed Dec 11, 2020
1 parent b12efb2 commit b930d99
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/seedu/address/model/person/Person.java
Expand Up @@ -111,9 +111,13 @@ public String toString() {
.append("; Email: ")
.append(getEmail())
.append("; Address: ")
.append(getAddress())
.append("; Tags: ");
getTags().forEach(builder::append);
.append(getAddress());

Set<Tag> tags = getTags();
if (!tags.isEmpty()) {
builder.append("; Tags: ");
tags.forEach(builder::append);
}
return builder.toString();
}

Expand Down

0 comments on commit b930d99

Please sign in to comment.