-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventInfo.java
275 lines (228 loc) · 5.41 KB
/
EventInfo.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
package com.deange.uwaterlooapi.model.events;
import android.os.Parcel;
import android.os.Parcelable;
import com.deange.uwaterlooapi.model.BaseModel;
import com.deange.uwaterlooapi.model.common.Image;
import com.deange.uwaterlooapi.model.common.MultidayDateRange;
import com.deange.uwaterlooapi.utils.DateUtils;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
import java.util.List;
public class EventInfo
extends BaseModel
implements
Parcelable {
@SerializedName("id")
int mId;
@SerializedName("title")
String mTitle;
@SerializedName("description")
String mDescription;
@SerializedName("description_raw")
String mDescriptionRaw;
@SerializedName("times")
List<MultidayDateRange> mTimes;
@SerializedName("cost")
String mCost;
@SerializedName("audience")
List<String> mAudience;
@SerializedName("tags")
List<String> mTags;
@SerializedName("type")
List<String> mTypes;
@SerializedName("website")
Website mSite;
@SerializedName("host")
Website mHost;
@SerializedName("image")
Image mImage;
@SerializedName("location")
EventLocation mLocation;
@SerializedName("site_name")
String mSiteName;
@SerializedName("site_id")
String mSiteId;
@SerializedName("revision_id")
int mRevisionId;
@SerializedName("link")
String mLink;
@SerializedName("link_calendar")
String mLinkCalendar;
@SerializedName("updated")
String mUpdated;
protected EventInfo(final Parcel in) {
super(in);
mId = in.readInt();
mTitle = in.readString();
mDescription = in.readString();
mDescriptionRaw = in.readString();
mTimes = in.createTypedArrayList(MultidayDateRange.CREATOR);
mCost = in.readString();
mAudience = in.createStringArrayList();
mTags = in.createStringArrayList();
mTypes = in.createStringArrayList();
mSite = in.readParcelable(Website.class.getClassLoader());
mHost = in.readParcelable(Website.class.getClassLoader());
mImage = in.readParcelable(Image.class.getClassLoader());
mLocation = in.readParcelable(EventLocation.class.getClassLoader());
mSiteName = in.readString();
mSiteId = in.readString();
mRevisionId = in.readInt();
mLink = in.readString();
mLinkCalendar = in.readString();
mUpdated = in.readString();
}
@Override
public void writeToParcel(final Parcel dest, final int flags) {
super.writeToParcel(dest, flags);
dest.writeInt(mId);
dest.writeString(mTitle);
dest.writeString(mDescription);
dest.writeString(mDescriptionRaw);
dest.writeTypedList(mTimes);
dest.writeString(mCost);
dest.writeStringList(mAudience);
dest.writeStringList(mTags);
dest.writeStringList(mTypes);
dest.writeParcelable(mSite, flags);
dest.writeParcelable(mHost, flags);
dest.writeParcelable(mImage, flags);
dest.writeParcelable(mLocation, flags);
dest.writeString(mSiteName);
dest.writeString(mSiteId);
dest.writeInt(mRevisionId);
dest.writeString(mLink);
dest.writeString(mLinkCalendar);
dest.writeString(mUpdated);
}
public static final Creator<EventInfo> CREATOR = new Creator<EventInfo>() {
@Override
public EventInfo createFromParcel(final Parcel in) {
return new EventInfo(in);
}
@Override
public EventInfo[] newArray(final int size) {
return new EventInfo[size];
}
};
/**
* Unique event id
*/
public int getId() {
return mId;
}
/**
* Event title
*/
public String getTitle() {
return mTitle;
}
/**
* Event description
*/
public String getDescription() {
return mDescription;
}
/**
* Raw event description (includes HTML markup)
*/
public String getDescriptionRaw() {
return mDescriptionRaw;
}
/**
* The event's times
*/
public List<MultidayDateRange> getTimes() {
return mTimes;
}
/**
* Cost of event
*/
public String getCost() {
return mCost;
}
/**
* Audience targeted by event
*/
public List<String> getAudience() {
return mAudience;
}
/**
* Tags related to event
*/
public List<String> getTags() {
return mTags;
}
/**
* Type of event
*/
public List<String> getTypes() {
return mTypes;
}
/**
* The event's website for more information
*/
public Website getSite() {
return mSite;
}
/**
* The event's host's website for more information
*/
public Website getHost() {
return mHost;
}
/**
* Image representing the event
*/
public Image getImage() {
return mImage;
}
/**
* Location of the event
*/
public EventLocation getLocation() {
return mLocation;
}
/**
* Full site name as from https://api.uwaterloo.ca/v2/resources/sites.json
*/
public String getSiteName() {
return mSiteName;
}
/**
* Site slug as from https://api.uwaterloo.ca/v2/resources/sites.json
*/
public String getSiteId() {
return mSiteId;
}
/**
* Unique id of revision of event
*/
public int getRevisionId() {
return mRevisionId;
}
/**
* URL of event link
*/
public String getLink() {
return mLink;
}
/**
* iCal feed of event
*/
public String getLinkCalendar() {
return mLinkCalendar;
}
/**
* ISO 8601 formatted updated date
*/
public Date getLastUpdatedDate() {
return DateUtils.parseDate(mUpdated);
}
/**
* ISO 8601 formatted updated date as a string
*/
public String getRawLastUpdatedDate() {
return mUpdated;
}
}