java.lang.Object
page.codeberg.friedolyn.grades.Module
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Uniquely identifies the module among all modules of the university, e.g.private ECTS
The number of ECTS credits the module is worth.The exams that are part of the module and that have already been entered into the Friedolin system.private Grade
private Semester
When the module took place.private Exam.ExamStatus
Whether the module is finished and, if so, whether successfully or not.private String
The human-readable name of the module, e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
getCode()
getECTS()
getExams()
getGrade()
@NonNull Optional
<Exam.ExamStatus> getTitle()
@NonNull Exam
removeExam
(int index) boolean
removeExam
(@NonNull Exam exam) removeExams
(int... indices) boolean
removeExams
(@NonNull Exam... exams) void
void
Updates thecode
of the module, which uniquely identifies the module among all modules of the university.void
void
void
setSemester
(@NonNull Semester semester) Updates thesemester
in which the module took place.void
setStatus
(Exam.ExamStatus status) Updates thestatus
of the module, whether the module is finished and, if so, whether successfully or not.void
Updates thetitle
of the module, the human-readable name of the module.@NonNull String
toString()
@NonNull String
Redacts sensitive information from the string representation of this Module object, by callingRedactable.toStringRedacted()
on#grade
and allExams
in theEXAMS
list.
-
Field Details
-
code
Uniquely identifies the module among all modules of the university, e.g.FMI-IN0144
for the module “Fortgeschrittenes Programmierpraktikum” (meaning “Advanced Programming Lab”) of the Faculty of Mathematics and Informatics. -
title
The human-readable name of the module, e.g.Fortgeschrittenes Programmierpraktikum
(meaning “Advanced Programming Lab”). -
semester
When the module took place. -
grade
-
status
Whether the module is finished and, if so, whether successfully or not. -
ects
-
EXAMS
-
-
Constructor Details
-
Module
public Module()
-
-
Method Details
-
getExams
-
getCode
-
getTitle
-
getSemester
-
getGrade
-
getStatus
- Returns:
- The
status
of the module, whether the module is finished and, if so, whether successfully or not.
-
getECTS
-
setCode
Updates thecode
of the module, which uniquely identifies the module among all modules of the university.- Parameters:
code
- The newcode
of the module. Must not be blank.- Throws:
IllegalArgumentException
- If the given code is blank.
-
setTitle
Updates thetitle
of the module, the human-readable name of the module.- Parameters:
title
- The newtitle
of the module. Must not be blank.- Throws:
IllegalArgumentException
- If the given title is blank.
-
setSemester
-
setGrade
-
setStatus
-
setECTS
-
addExam
-
addExams
-
addExams
-
removeExam
-
removeExams
- Parameters:
exams
- The Exams to remove from the module.- Returns:
true
if the list of exams was modified as a result of this operation.- Implementation Note:
- See
ArrayList.removeAll(Collection)
.
-
removeExam
- Parameters:
index
- The index of the Exam to remove from the module. Must be between 0 (inclusive) and the size of the exams list (exclusive).- Throws:
IndexOutOfBoundsException
- If the index is out of bounds.
-
removeExams
@NonNull public @NonNull ArrayList<Exam> removeExams(int... indices) throws IndexOutOfBoundsException - Parameters:
indices
- The indices of the Exams to remove from the module. Must be between 0 (inclusive) and the size of the exams list (exclusive).- Returns:
- The Exams that were removed from the module.
- Throws:
IndexOutOfBoundsException
- If any of the indices are out of bounds.
-
resetExams
-
toString
- Specified by:
toString
in interfaceRedactable
- Overrides:
toString
in classObject
- Returns:
- A string representation of this Module object.
-
toStringRedacted
Redacts sensitive information from the string representation of this Module object, by callingRedactable.toStringRedacted()
on#grade
and allExams
in theEXAMS
list.- Specified by:
toStringRedacted
in interfaceRedactable
- Returns:
- A redacted string representation of this Module object.
-