-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCallLogModel.java
More file actions
43 lines (36 loc) · 1.05 KB
/
CallLogModel.java
File metadata and controls
43 lines (36 loc) · 1.05 KB
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
34
35
36
37
38
39
40
41
42
43
public class CallLogModel {
private int duration;
private String phone;
public int getDuration() {
return duration;
}
public void setDuration(int duration) {
this.duration = duration;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
// needed for using Comparator, see Java source about comparator usage
@Override
public int hashCode() {
return String.valueOf(phone).hashCode();
}
// needed for using Comparator, see Java source about comparator usage
@Override
public boolean equals(Object obj) {
if (obj == null || !(obj instanceof CallLogModel))
return false;
CallLogModel c = (CallLogModel) obj;
return String.valueOf(c.getPhone()).equals(String.valueOf(phone));
}
@Override
public String toString() {
return "CallLogModel{" +
"duration=" + duration +
", phone='" + phone + '\'' +
'}';
}
}