-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourse.java
119 lines (98 loc) · 2.35 KB
/
Course.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
package com.deange.uwaterlooapi.model.courses;
import android.os.Parcel;
import android.os.Parcelable;
import com.deange.uwaterlooapi.model.BaseModel;
import com.google.gson.annotations.SerializedName;
public class Course
extends BaseModel
implements
Parcelable {
@SerializedName("course_id")
String mCourseId;
@SerializedName("subject")
String mSubject;
@SerializedName("catalog_number")
String mCatalogNumber;
@SerializedName("title")
String mTitle;
@SerializedName("units")
float mUnits;
@SerializedName("description")
String mDescription;
@SerializedName("academic_level")
String mAcademicLevel;
protected Course(final Parcel in) {
super(in);
mCourseId = in.readString();
mSubject = in.readString();
mCatalogNumber = in.readString();
mTitle = in.readString();
mUnits = in.readFloat();
mDescription = in.readString();
mAcademicLevel = in.readString();
}
@Override
public void writeToParcel(final Parcel dest, final int flags) {
super.writeToParcel(dest, flags);
dest.writeString(mCourseId);
dest.writeString(mSubject);
dest.writeString(mCatalogNumber);
dest.writeString(mTitle);
dest.writeFloat(mUnits);
dest.writeString(mDescription);
dest.writeString(mAcademicLevel);
}
public static final Creator<Course> CREATOR = new Creator<Course>() {
@Override
public Course createFromParcel(final Parcel in) {
return new Course(in);
}
@Override
public Course[] newArray(final int size) {
return new Course[size];
}
};
/**
* Registrar assigned course ID
*/
public int getCourseId() {
// Ensure it is not interpreted as octal
return Integer.parseInt(mCourseId, 10);
}
/**
* Requested subject acronym
*/
public String getSubject() {
return mSubject;
}
/**
* Registrar assigned class number
*/
public String getCatalogNumber() {
return mCatalogNumber;
}
/**
* Class name and title
*/
public String getTitle() {
return mTitle;
}
/**
* Brief course description
*/
public String getDescription() {
return mDescription;
}
/**
* Credit count for the mentioned course
*/
public float getUnits() {
return mUnits;
}
/**
* Undergraduate or graduate course classification
*/
public String getAcademicLevel() {
return mAcademicLevel;
}
}