-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote.java
92 lines (75 loc) · 1.72 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package com.deange.uwaterlooapi.model.foodservices;
import android.os.Parcel;
import android.os.Parcelable;
import com.deange.uwaterlooapi.model.BaseModel;
import com.deange.uwaterlooapi.utils.DateUtils;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
public class Note
extends BaseModel
implements
Parcelable {
@SerializedName("date")
String mDate;
@SerializedName("outlet_id")
int mOutletId;
@SerializedName("outlet_name")
String mOutletName;
@SerializedName("note")
String mNote;
protected Note(final Parcel in) {
super(in);
mDate = in.readString();
mOutletId = in.readInt();
mOutletName = in.readString();
mNote = in.readString();
}
@Override
public void writeToParcel(final Parcel dest, final int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mDate);
dest.writeInt(mOutletId);
dest.writeString(mOutletName);
dest.writeString(mNote);
}
public static final Creator<Note> CREATOR = new Creator<Note>() {
@Override
public Note createFromParcel(final Parcel in) {
return new Note(in);
}
@Override
public Note[] newArray(final int size) {
return new Note[size];
}
};
/**
* Outlet ID as per /foodservices/outlets
*/
public int getOutletId() {
return mOutletId;
}
/**
* Outlet name as per /foodservices/outlets
*/
public String getOutletName() {
return mOutletName;
}
/**
* Note
*/
public String getNote() {
return mNote;
}
/**
* Menu date object
*/
public Date getDate() {
return DateUtils.parseDate(mDate, DateUtils.YMD);
}
/**
* Menu date object as a string
*/
public String getRawDate() {
return mDate;
}
}