-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNote.java
More file actions
68 lines (60 loc) · 1.57 KB
/
Copy pathNote.java
File metadata and controls
68 lines (60 loc) · 1.57 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
public class Note {
public static String TITLE = "title";
public static String CONTENT = "content";
public static String TIMESTAMP = "timestamp";
public static String PRIORITY = "priority";
public static String CATEGORY = "category";
private String title;
private String content;
private long timestamp;
private int priority;
private Category category;
public Note(String title, String content, long timestamp, int priority, Category category) {
super();
this.title = title;
this.content = content;
this.timestamp = timestamp;
this.priority = priority;
this.category = category;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public long getTimestamp() {
return timestamp;
}
public void setTimestamp(long timestamp) {
this.timestamp = timestamp;
}
public int getPriority(){
return priority;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public String toString(){
return title + " " + " " + String.valueOf(priority) + " "+ content + " " + category + "\n";
}
public boolean equals(Object other){
if(other instanceof Note) {
Note otherNote = (Note) other;
return title.equals(otherNote.getTitle())
&& content.equals(otherNote.getContent())
&& timestamp == otherNote.getTimestamp()
&& category.equals(otherNote.getCategory());
} else
return false;
}
}