forked from AY2425S1-CS2103-F09-1/tp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request AY2425S1-CS2103-F09-1#53 from WinstonJin/Telegram-…
…Handle Telegram Handle
- Loading branch information
Showing
30 changed files
with
334 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,8 @@ | |
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_TELEGRAM; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_NICKNAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_ROLE; | ||
|
||
import seedu.address.commons.util.ToStringBuilder; | ||
|
@@ -24,14 +24,14 @@ public class AddCommand extends Command { | |
public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to the address book. " | ||
+ "Parameters: " | ||
+ PREFIX_NAME + "NAME " | ||
+ PREFIX_PHONE + "PHONE " | ||
+ PREFIX_TELEGRAM + "TELEGRAM " | ||
+ PREFIX_EMAIL + "EMAIL " | ||
+ PREFIX_ADDRESS + "ADDRESS " | ||
+ "[" + PREFIX_ROLE + "ROLE]...\n" | ||
+ "[" + PREFIX_NICKNAME + "NICKNAME]\n" | ||
+ "Example: " + COMMAND_WORD + " " | ||
+ PREFIX_NAME + "John Doe " | ||
+ PREFIX_PHONE + "98765432 " | ||
+ PREFIX_TELEGRAM + "98765432 " | ||
+ PREFIX_EMAIL + "[email protected] " | ||
+ PREFIX_ADDRESS + "311, Clementi Ave 2, #02-25 " | ||
+ PREFIX_ROLE + "Admin " | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
import static seedu.address.logic.parser.CliSyntax.PREFIX_ADDRESS; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_EMAIL; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_PHONE; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_TELEGRAM; | ||
import static seedu.address.logic.parser.CliSyntax.PREFIX_ROLE; | ||
import static seedu.address.model.Model.PREDICATE_SHOW_ALL_PERSONS; | ||
|
||
|
@@ -25,7 +25,7 @@ | |
import seedu.address.model.person.Email; | ||
import seedu.address.model.person.Name; | ||
import seedu.address.model.person.Person; | ||
import seedu.address.model.person.Phone; | ||
import seedu.address.model.person.Telegram; | ||
import seedu.address.model.tag.Nickname; | ||
import seedu.address.model.tag.Role; | ||
|
||
|
@@ -41,12 +41,12 @@ public class EditCommand extends Command { | |
+ "Existing values will be overwritten by the input values.\n" | ||
+ "Parameters: INDEX (must be a positive integer) " | ||
+ "[" + PREFIX_NAME + "NAME] " | ||
+ "[" + PREFIX_PHONE + "PHONE] " | ||
+ "[" + PREFIX_TELEGRAM + "TELEGRAM] " | ||
+ "[" + PREFIX_EMAIL + "EMAIL] " | ||
+ "[" + PREFIX_ADDRESS + "ADDRESS] " | ||
+ "[" + PREFIX_ROLE + "TAG]...\n" | ||
+ "Example: " + COMMAND_WORD + " 1 " | ||
+ PREFIX_PHONE + "91234567 " | ||
+ PREFIX_TELEGRAM + "91234567 " | ||
+ PREFIX_EMAIL + "[email protected]"; | ||
|
||
public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s"; | ||
|
@@ -97,12 +97,12 @@ private static Person createEditedPerson(Person personToEdit, EditPersonDescript | |
assert personToEdit != null; | ||
|
||
Name updatedName = editPersonDescriptor.getName().orElse(personToEdit.getName()); | ||
Phone updatedPhone = editPersonDescriptor.getPhone().orElse(personToEdit.getPhone()); | ||
Telegram updatedTelegram = editPersonDescriptor.getTelegram().orElse(personToEdit.getTelegram()); | ||
Email updatedEmail = editPersonDescriptor.getEmail().orElse(personToEdit.getEmail()); | ||
Address updatedAddress = editPersonDescriptor.getAddress().orElse(personToEdit.getAddress()); | ||
Set<Role> updatedRoles = editPersonDescriptor.getTags().orElse(personToEdit.getTags()); | ||
Nickname updatedNickname = editPersonDescriptor.getNickname().orElse(personToEdit.getNickname()); | ||
return new Person(updatedName, updatedPhone, updatedEmail, updatedAddress, updatedRoles, updatedNickname); | ||
return new Person(updatedName, updatedTelegram, updatedEmail, updatedAddress, updatedRoles, updatedNickname); | ||
} | ||
|
||
@Override | ||
|
@@ -135,7 +135,7 @@ public String toString() { | |
*/ | ||
public static class EditPersonDescriptor { | ||
private Name name; | ||
private Phone phone; | ||
private Telegram telegram; | ||
private Email email; | ||
private Address address; | ||
private Set<Role> roles; | ||
|
@@ -149,7 +149,7 @@ public EditPersonDescriptor() {} | |
*/ | ||
public EditPersonDescriptor(EditPersonDescriptor toCopy) { | ||
setName(toCopy.name); | ||
setPhone(toCopy.phone); | ||
setTelegram(toCopy.telegram); | ||
setEmail(toCopy.email); | ||
setAddress(toCopy.address); | ||
setTags(toCopy.roles); | ||
|
@@ -160,7 +160,7 @@ public EditPersonDescriptor(EditPersonDescriptor toCopy) { | |
* Returns true if at least one field is edited. | ||
*/ | ||
public boolean isAnyFieldEdited() { | ||
return CollectionUtil.isAnyNonNull(name, phone, email, address, roles); | ||
return CollectionUtil.isAnyNonNull(name, telegram, email, address, roles); | ||
} | ||
|
||
public void setName(Name name) { | ||
|
@@ -171,12 +171,12 @@ public Optional<Name> getName() { | |
return Optional.ofNullable(name); | ||
} | ||
|
||
public void setPhone(Phone phone) { | ||
this.phone = phone; | ||
public void setTelegram(Telegram telegram) { | ||
this.telegram = telegram; | ||
} | ||
|
||
public Optional<Phone> getPhone() { | ||
return Optional.ofNullable(phone); | ||
public Optional<Telegram> getTelegram() { | ||
return Optional.ofNullable(telegram); | ||
} | ||
|
||
public void setEmail(Email email) { | ||
|
@@ -233,7 +233,7 @@ public boolean equals(Object other) { | |
|
||
EditPersonDescriptor otherEditPersonDescriptor = (EditPersonDescriptor) other; | ||
return Objects.equals(name, otherEditPersonDescriptor.name) | ||
&& Objects.equals(phone, otherEditPersonDescriptor.phone) | ||
&& Objects.equals(telegram, otherEditPersonDescriptor.telegram) | ||
&& Objects.equals(email, otherEditPersonDescriptor.email) | ||
&& Objects.equals(address, otherEditPersonDescriptor.address) | ||
&& Objects.equals(roles, otherEditPersonDescriptor.roles) | ||
|
@@ -244,7 +244,7 @@ public boolean equals(Object other) { | |
public String toString() { | ||
return new ToStringBuilder(this) | ||
.add("name", name) | ||
.add("phone", phone) | ||
.add("telegram", telegram) | ||
.add("email", email) | ||
.add("address", address) | ||
.add("tags", roles) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.