Package org.dnsge.powerschoolapi.detail
Class Course
- java.lang.Object
-
- org.dnsge.powerschoolapi.detail.Course
-
- Direct Known Subclasses:
DetailedCourse
public class Course extends java.lang.Object
Object that represents a Course in Powerschool- Version:
- 1.0.3
-
-
Constructor Summary
Constructors Constructor Description Course(java.lang.String courseName, java.lang.String courseFrequency, java.lang.String teacherFirstName, java.lang.String teacherLastName, java.lang.String teacherEmail, java.lang.String room, java.util.List<GradeGroup> courseGrades, User user)
Basic constructor for a CourseCourse(java.util.List<GradeGroup> courseGrades, User user)
Constructor for a Course with incomplete information
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
courseIdentifier()
boolean
equals(java.lang.Object o)
static Course
generateCourseFromElement(org.jsoup.nodes.Element genElement, User user, ViewSpecification viewSpecification)
Generates a newCourse
from a<tr>
HTML elementjava.util.List<Assignment>
getAssignments(GradingPeriod gradingPeriod)
Gets all assignments for this Coursejava.lang.String
getCourseFrequency()
java.util.List<GradeGroup>
getCourseGrades()
java.lang.String
getCourseName()
GradeGroup
getGradeGroup(GradingPeriod gradingPeriod)
Gets theGradeGroup
object for this Course during a specificGradingPeriod
java.lang.String
getRoom()
java.lang.String
getTeacherEmail()
java.lang.String
getTeacherFirstName()
java.lang.String
getTeacherLastName()
User
getUser()
int
hashCode()
java.lang.String
objectIdentifier()
java.lang.String
toString()
-
-
-
Constructor Detail
-
Course
public Course(java.lang.String courseName, java.lang.String courseFrequency, java.lang.String teacherFirstName, java.lang.String teacherLastName, java.lang.String teacherEmail, java.lang.String room, java.util.List<GradeGroup> courseGrades, User user)
Basic constructor for a Course- Parameters:
courseName
- Name of the CoursecourseFrequency
- Frequency 'code' of the CourseteacherFirstName
- Teacher's first nameteacherLastName
- Teacher's last nameteacherEmail
- Teacher's emailroom
- Course's room numbercourseGrades
- List of course's gradesuser
- User which the Course belongs to
-
Course
public Course(java.util.List<GradeGroup> courseGrades, User user)
Constructor for a Course with incomplete information- Parameters:
courseGrades
- List of gradesuser
- User which the Course belongs to
-
-
Method Detail
-
generateCourseFromElement
public static Course generateCourseFromElement(org.jsoup.nodes.Element genElement, User user, ViewSpecification viewSpecification)
Generates a newCourse
from a<tr>
HTML element- Parameters:
genElement
-<tr>
element to construct a class fromuser
- User that the new course belongs toviewSpecification
-ViewSpecification
that should be used to make the Course- Returns:
- The new course
-
getGradeGroup
public GradeGroup getGradeGroup(GradingPeriod gradingPeriod)
Gets theGradeGroup
object for this Course during a specificGradingPeriod
- Parameters:
gradingPeriod
- GradingPeriod which to get the GradeGroup from- Returns:
- GradeGroup found
- See Also:
GradingPeriod
,GradeGroup
-
getAssignments
public java.util.List<Assignment> getAssignments(GradingPeriod gradingPeriod)
Gets all assignments for this Course- Parameters:
gradingPeriod
-GradingPeriod
which to get the assignments from- Returns:
List
of assignments found- See Also:
Assignment
-
courseIdentifier
public java.lang.String courseIdentifier()
-
objectIdentifier
public java.lang.String objectIdentifier()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- Returns:
- A
String
formatted like"{Course Name} - {Teacher Last Name} ({Course Grades toString()})"
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getCourseGrades
public java.util.List<GradeGroup> getCourseGrades()
- Returns:
Course
grades
-
getCourseFrequency
public java.lang.String getCourseFrequency()
- Returns:
Course
frequency code
-
getCourseName
public java.lang.String getCourseName()
- Returns:
Course
name
-
getRoom
public java.lang.String getRoom()
- Returns:
Course
room number (might not exist)
-
getTeacherEmail
public java.lang.String getTeacherEmail()
- Returns:
Course
teacher's email address
-
getTeacherFirstName
public java.lang.String getTeacherFirstName()
- Returns:
Course
teacher's first name
-
getTeacherLastName
public java.lang.String getTeacherLastName()
- Returns:
Course
teacher's last name
-
-