Commit 6bdae805 authored by NewbieOrange's avatar NewbieOrange
Browse files

Update DTOs for data deserialization and reformat javadoc

parent 68edc916
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ public class Course {
    }

    // A courseId is valid if it has been added to the system with addCourse()
    // do not check whether it is 'CS307' or '307CS'
    // Do not check whether it is 'CS307' or '307CS'
    public String id;

    public String name;
+4 −4
Original line number Diff line number Diff line
@@ -21,9 +21,9 @@ public class CourseSearchEntry {
    public Set<CourseSectionClass> sectionClasses;

    /**
     * List all course or time conflicting courses' full name, sorted alphabetically.
     * List all time conflicting courses' full name, sorted alphabetically.
     * Course full name: String.format("%s[%s]", course.name, section.name)
     *
     * <p>
     * Course conflict is when multiple sections belong to the same course.
     * Time conflict is when multiple sections have time-overlapping classes.
     * Note that a section is both course and time conflicting with itself!
@@ -39,8 +39,8 @@ public class CourseSearchEntry {
            return false;
        }
        CourseSearchEntry entry = (CourseSearchEntry) o;
        return course.equals(entry.course) && section.equals(entry.section) && sectionClasses
                .equals(entry.sectionClasses)
        return course.equals(entry.course) && section.equals(entry.section)
                && sectionClasses.equals(entry.sectionClasses)
                && conflictCourseNames.equals(entry.conflictCourseNames);
    }

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ public class CourseSectionClass {
    // The given elements in weekList are sorted.
    // CourseSectionClasses in same courseSection may have different week list.
    public Set<Short> weekList;
    // The time quantum of start and end.
    // The time quantum of start and end (closed interval).
    // For example: classStart is 3 while classEnd is 4
    public short classBegin, classEnd;
    public String location;
+5 −1
Original line number Diff line number Diff line
package cn.edu.sustech.cs307.dto.grade;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public final class HundredMarkGrade implements Grade {
    public final short mark;

    public HundredMarkGrade(short mark) {
    @JsonCreator
    public HundredMarkGrade(@JsonProperty("mark") short mark) {
        this.mark = mark;
    }

+11 −4
Original line number Diff line number Diff line
package cn.edu.sustech.cs307.dto.prerequisite;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.annotation.Nonnull;
import java.util.List;
import java.util.Objects;
@@ -11,17 +14,21 @@ import java.util.Objects;
 * {@code terms} are fulfilled.
 */
public class AndPrerequisite implements Prerequisite {

    public final List<Prerequisite> terms;

    public AndPrerequisite(@Nonnull List<Prerequisite> terms) {
    @JsonCreator
    public AndPrerequisite(@JsonProperty("terms") @Nonnull List<Prerequisite> terms) {
        this.terms = terms;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        AndPrerequisite that = (AndPrerequisite) o;
        return terms.equals(that.terms);
    }
Loading