java.lang.Object
page.codeberg.friedolyn.grades.Exam
- All Implemented Interfaces:
Copyable<Exam>,Redactable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether the exam is over and, if so, whether successful or not. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LocalDateThe date on which the exam was added to the student's grades table in the Friedolin system.private IntegerWhich time the student took the exam, starting with 1 for the first attempt.private LocalDateThe date on which the exam took place.private StringThe name of the professor who conducted the exam, graded it or was responsible for the accounting.private StringThe “Prüfungsnummer” (exam number) assigned to the exam, without the labelP-Nr.:.private StringThe human-readable name of the exam, e.g.private GradeThe student's grade in the exam, between 0.7 and 5.0.private SemesterThe semester in which the exam took place.private Exam.ExamStatusWhether the exam is over and, if so, whether successful or not. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeDifference(@NonNull Exam other) @NonNull Examcopy()booleanCompares thisExamwith the given object.getGrade()@NonNull Optional<Exam.ExamStatus> voidsetAccountingDate(@NonNull LocalDate accountingDate) Updates theaccountingDateto the given value.voidsetAttempt(int attempt) Updates theattemptto the given value.voidsetExamDate(@NonNull LocalDate examDate) Updates theexamDateto the given value.voidsetExaminer(@NonNull String examiner) Updates theexaminerto the given value.voidsetExamNumber(@NonNull String examNumber) Updates theexamNumberto the given value.voidsetExamTitle(@NonNull String examTitle) Updates thehuman-readable name of the examto the given value.voidUpdates thegradeto the given value.voidsetSemester(@NonNull Semester semester) Updates thesemesterto the given value.voidsetStatus(@NonNull Exam.ExamStatus status) Updates thestatusto the given value.@NonNull StringtoString()@NonNull String
-
Field Details
-
examNumber
The “Prüfungsnummer” (exam number) assigned to the exam, without the labelP-Nr.:.
-
examTitle
The human-readable name of the exam, e.g.Fortgeschrittenes Programmierpraktikum: ProjektorSystemsoftware: Klausur oder mündliche Prüfung. -
semester
-
grade
-
status
Whether the exam is over and, if so, whether successful or not. -
attempt
Which time the student took the exam, starting with 1 for the first attempt. -
examDate
The date on which the exam took place. May be missing for unknown reasons.Missing exam date:

-
examiner
The name of the professor who conducted the exam, graded it or was responsible for the accounting. Which role the examiner had is not specified by the Friedolin system. May be missing for unknown reasons.Missing examiner:

-
accountingDate
The date on which the exam was added to the student's grades table in the Friedolin system.
-
-
Constructor Details
-
Exam
public Exam()
-
-
Method Details
-
getExamNumber
- Returns:
- The
examNumber, if present. Empty otherwise.
-
getExamTitle
-
getSemester
-
getGrade
-
getStatus
- Returns:
- The
status, if present. Empty otherwise.
-
getAttempt
-
getExamDate
-
getExaminer
-
getAccountingDate
- Returns:
- The
accountingDate, if present. Empty otherwise.
-
setExamNumber
Updates theexamNumberto the given value. Strips the labelP-Nr.:from the value, if present.- Parameters:
examNumber- The new exam number. Expected (but not enforced) to be in the formatP-Nr.: 123456. Must not be blank.- Throws:
IllegalArgumentException- If the exam number is blank.
-
setExamTitle
Updates thehuman-readable name of the examto the given value.- Parameters:
examTitle- The new exam's name. Must not be blank.- Throws:
IllegalArgumentException- If the exam title is blank.
-
setSemester
-
setGrade
-
setStatus
Updates thestatusto the given value.- Parameters:
status- Whether the exam is over and, if so, whether successful or not. Must not be blank.
-
setAttempt
Updates theattemptto the given value.- Parameters:
attempt- Which time the student took the exam, starting with 1 for the first attempt. Must be greater than 0.- Throws:
IllegalArgumentException- If the attempt number is less than 1.
-
setExamDate
Updates theexamDateto the given value.- Parameters:
examDate- The date on which the exam took place. Must be after 1990-10-03 and before today + 1 year.- Throws:
IllegalArgumentException- If the exam date is before 1990-10-03 or after today + 1 year.
-
setExaminer
Updates theexaminerto the given value.- Parameters:
examiner- The name of the professor who conducted the exam, graded it or was responsible for the accounting. Must not be blank.- Throws:
IllegalArgumentException- If the examiner's name is blank.
-
setAccountingDate
public void setAccountingDate(@NonNull @NonNull LocalDate accountingDate) throws IllegalArgumentException Updates theaccountingDateto the given value.- Parameters:
accountingDate- The date on which the exam was added to the student's grades table in the Friedolin system. Must be after 1990-10-03 and before today + 1 year.- Throws:
IllegalArgumentException- If the accounting date is before 1990-10-03 or after today + 1 year.
-
equals
Compares thisExamwith the given object.- Overrides:
equalsin classObject- Parameters:
object- The object to compare this Exam with.- Returns:
-
trueif the given object is an Exam whose fields' values match their equivalents in this Exam, especially (but not exclusively) if the given Exam is the exact same reference as this Exam. -
falseif the given object is not an Exam or if any of the fields' values differ from their equivalents in this Exam.
-
-
computeDifference
- Parameters:
other- A different Exam reference to compare this Exam with.- Returns:
-
Changes.oldVersion(): A new Exam with the values of those fields of this Exam that differ from their equivalents in the given Exam. -
Changes.newVersion(): A new Exam with the values of those fields of the given Exam that differ from their equivalents in this Exam. -
Changes.unchanged(): A new Exam with the values of those fields that are the same in both Exams.
-
-
copy
-
toString
- Specified by:
toStringin interfaceRedactable- Overrides:
toStringin classObject- Returns:
- A string representation of this Exam.
-
toStringRedacted
- Specified by:
toStringRedactedin interfaceRedactable- Returns:
- A redacted string representation of this Exam.
-

