-
Notifications
You must be signed in to change notification settings - Fork 458
Expand file tree
/
Copy pathRemark.java
More file actions
33 lines (27 loc) · 766 Bytes
/
Remark.java
File metadata and controls
33 lines (27 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package seedu.address.model.person;
import static java.util.Objects.requireNonNull;
/**
* Represents a Person's remark in the address book.
* Guarantees: immutable; is always valid
*/
public class Remark {
public final String value;
public Remark(String remark) {
requireNonNull(remark);
value = remark;
}
@Override
public String toString() {
return value;
}
@Override
public boolean equals(Object other) {
return other == this // short circuit if same object
|| (other instanceof Remark // instanceof handles nulls
&& value.equals(((Remark) other).value)); // state check
}
@Override
public int hashCode() {
return value.hashCode();
}
}