Package org.dnsge.powerschoolapi.detail
Class CourseGetter
- java.lang.Object
-
- org.dnsge.powerschoolapi.detail.CourseGetter
-
public class CourseGetter extends java.lang.ObjectClass for filtering / searching for courses in an ArrayList by different attributes like name, frequency, or teacher last nameAllows the use of method chaining
- Version:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description CourseGetter(java.util.List<Course> courses)Creates the CourseGetter with a preliminary list of Courses
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CourseGettercontainsByFrequency(java.lang.String courseFrequency)Limits remaining courses to contain the frequencyCourseGettercontainsByName(java.lang.String name)Limits remaining courses to contain the nameCourseGettercontainsByTeacherLastName(java.lang.String teacherLastName)Limits remaining courses to contain the teacher last nameCoursefirst()Courseget(int index)Gets the nth resultCourseGetterlimitByFrequency(java.lang.String courseFrequency)Limits remaining courses to have the exact frequencyCourseGetterlimitByName(java.lang.String name)Limits remaining courses to have the exact nameCourseGetterlimitByTeacherLastName(java.lang.String teacherLastName)Limits remaining courses to have the exact teacher last namejava.util.List<Course>results()intsize()Returns the number of results.
-
-
-
Constructor Detail
-
CourseGetter
public CourseGetter(java.util.List<Course> courses)
Creates the CourseGetter with a preliminary list of Courses- Parameters:
courses- ArrayList to search through
-
-
Method Detail
-
limitByName
public CourseGetter limitByName(java.lang.String name)
Limits remaining courses to have the exact name- Parameters:
name- Exact name to find- Returns:
- this CourseGetter with updated information
-
containsByName
public CourseGetter containsByName(java.lang.String name)
Limits remaining courses to contain the name- Parameters:
name- Name to find- Returns:
- this CourseGetter with updated information
-
limitByFrequency
public CourseGetter limitByFrequency(java.lang.String courseFrequency)
Limits remaining courses to have the exact frequency- Parameters:
courseFrequency- Exact frequency to find- Returns:
- this CourseGetter with updated information
-
containsByFrequency
public CourseGetter containsByFrequency(java.lang.String courseFrequency)
Limits remaining courses to contain the frequency- Parameters:
courseFrequency- Frequency to find- Returns:
- this CourseGetter with updated information
-
limitByTeacherLastName
public CourseGetter limitByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to have the exact teacher last name- Parameters:
teacherLastName- Exact last name to find- Returns:
- this CourseGetter with updated information
-
containsByTeacherLastName
public CourseGetter containsByTeacherLastName(java.lang.String teacherLastName)
Limits remaining courses to contain the teacher last name- Parameters:
teacherLastName- Last name to find- Returns:
- this CourseGetter with updated information
-
results
public java.util.List<Course> results()
- Returns:
- New ArrayList Object with the results of the filtering
-
size
public int size()
Returns the number of results.- Returns:
- the number of results
-
get
public Course get(int index)
Gets the nth result- Parameters:
index- Result number to get- Returns:
- Result at the requested index
-
first
public Course first()
- Returns:
- First Course in the results
-
-