-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote.java
75 lines (59 loc) · 1.75 KB
/
Note.java
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
69
70
71
72
73
74
75
package com.example.christopherono.adaptermednote;
/**
* Created by ChristopherOno on 2016-11-17.
*/
public class Note {
private String title, message;
private long noteId, dateCreatedMilli;
private Category category;
public enum Category{ Christopher, Kärlek, Nurre, RoseMarie};
public Note(String title, String message, Category category){
this.title = title;
this.message = message;
this.category = category;
this.noteId = 0;
this.dateCreatedMilli = 0;
}
public Note(String title, String message, Category category, long noteId, long dateCreatedMilli){
this.title = title;
this.message = message;
this.category = category;
this.noteId = noteId;
this.dateCreatedMilli = dateCreatedMilli;
}
public String getTitle(){
return title;
}
public String getMEssage(){
return message;
}
public Category getCategory(){
return category;
}
public long getDate(){
return dateCreatedMilli;
}
public long getId(){
return noteId;
}
public String toString(){
return "ID: " + noteId + "Title: " + title + "Message: " + message + " IconID: " + category.name()
+ " Date: ";
}
public int getAssociatedDrawable(){
return categoryToDrawable(category);
}
public static int categoryToDrawable(Category noteCategory){
switch(noteCategory){
case Christopher:
return R.drawable.c;
case Kärlek:
return R.drawable.k;
case Nurre:
return R.drawable.n;
case RoseMarie:
return R.drawable.r;
}
return R.drawable.c;
}
}