Skip to content

Commit

Permalink
Remove unused details from Person.java
Browse files Browse the repository at this point in the history
  • Loading branch information
DESKTOP-CP7BI1I\Eujin committed Mar 20, 2024
1 parent cf840f3 commit 79bb3a8
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions src/main/java/seedu/address/model/person/Person.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,22 @@ public class Person {

// Identity fields
private final Name name;
private final Phone phone;
private final Email email;
private final Dob dob;
private final Ic ic;


// Data fields
private final Address address;
private final Set<Tag> tags = new HashSet<>();
private final AdmissionDate admissionDate;
private final Ward ward;

/**
* Every field must be present and not null.
*/
public Person(Name name, Phone phone, Email email, Address address, Set<Tag> tags,
public Person(Name name, Set<Tag> tags,
Dob dob, Ic ic, AdmissionDate admissionDate, Ward ward) {
requireAllNonNull(name, phone, email, address, tags, dob, ic, admissionDate, ward);
requireAllNonNull(name, tags, dob, ic, admissionDate, ward);
this.name = name;
this.phone = phone;
this.email = email;
this.address = address;
this.tags.addAll(tags);
this.dob = dob;
this.ic = ic;
Expand All @@ -51,18 +45,6 @@ public Name getName() {
return name;
}

public Phone getPhone() {
return phone;
}

public Email getEmail() {
return email;
}

public Address getAddress() {
return address;
}

/**
* Returns an immutable tag set, which throws {@code UnsupportedOperationException}
* if modification is attempted.
Expand Down Expand Up @@ -113,9 +95,6 @@ public boolean equals(Object other) {

Person otherPerson = (Person) other;
return name.equals(otherPerson.name)
&& phone.equals(otherPerson.phone)
&& email.equals(otherPerson.email)
&& address.equals(otherPerson.address)
&& tags.equals(otherPerson.tags)
&& dob.equals(otherPerson.dob)
&& ic.equals(otherPerson.ic)
Expand All @@ -126,16 +105,13 @@ public boolean equals(Object other) {
@Override
public int hashCode() {
// use this method for custom fields hashing instead of implementing your own
return Objects.hash(name, phone, email, address, tags, dob, ic, admissionDate, ward);
return Objects.hash(name, tags, dob, ic, admissionDate, ward);
}

@Override
public String toString() {
return new ToStringBuilder(this)
.add("name", name)
.add("phone", phone)
.add("email", email)
.add("address", address)
.add("tags", tags)
.add("dob", dob)
.add("ic", ic)
Expand Down

0 comments on commit 79bb3a8

Please sign in to comment.