Skip to content

Commit

Permalink
JsonAdaptedPerson: Change variable name tagged -> tags
Browse files Browse the repository at this point in the history
The JsonAdaptedPerson class contains a list object called 'tagged'.

According to our coding standard, a variable holding a collection
of items should have a plural form name.

Let's change the variable name to 'tags' instead.
  • Loading branch information
Py0000 authored and damithc committed May 12, 2023
1 parent f0c6861 commit d547e3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/seedu/address/storage/JsonAdaptedPerson.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ class JsonAdaptedPerson {
private final String phone;
private final String email;
private final String address;
private final List<JsonAdaptedTag> tagged = new ArrayList<>();
private final List<JsonAdaptedTag> tags = new ArrayList<>();

/**
* Constructs a {@code JsonAdaptedPerson} with the given person details.
*/
@JsonCreator
public JsonAdaptedPerson(@JsonProperty("name") String name, @JsonProperty("phone") String phone,
@JsonProperty("email") String email, @JsonProperty("address") String address,
@JsonProperty("tagged") List<JsonAdaptedTag> tagged) {
@JsonProperty("tagged") List<JsonAdaptedTag> tags) {
this.name = name;
this.phone = phone;
this.email = email;
this.address = address;
if (tagged != null) {
this.tagged.addAll(tagged);
if (tags != null) {
this.tags.addAll(tags);
}
}

Expand All @@ -54,7 +54,7 @@ public JsonAdaptedPerson(Person source) {
phone = source.getPhone().value;
email = source.getEmail().value;
address = source.getAddress().value;
tagged.addAll(source.getTags().stream()
tags.addAll(source.getTags().stream()
.map(JsonAdaptedTag::new)
.collect(Collectors.toList()));
}
Expand All @@ -66,7 +66,7 @@ public JsonAdaptedPerson(Person source) {
*/
public Person toModelType() throws IllegalValueException {
final List<Tag> personTags = new ArrayList<>();
for (JsonAdaptedTag tag : tagged) {
for (JsonAdaptedTag tag : tags) {
personTags.add(tag.toModelType());
}

Expand Down

0 comments on commit d547e3c

Please sign in to comment.