Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core:model 생성 #311

Merged
merged 37 commits into from
Jul 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
68f3010
:core:model 추가
eastshine2741 Jul 7, 2024
8925e9f
Building, PlaceTime 추가
eastshine2741 Jul 7, 2024
e2c2974
Color 추가
eastshine2741 Jul 7, 2024
6732d7e
Lecture 추가
eastshine2741 Jul 7, 2024
5628899
CourseBook 추가
eastshine2741 Jul 7, 2024
62fdb99
Lecture 필드 rename
eastshine2741 Jul 7, 2024
a5edaa5
Notification 추가
eastshine2741 Jul 7, 2024
b4a5e4d
User, Nickname 추가
eastshine2741 Jul 7, 2024
2c8dff0
TableTheme 추가
eastshine2741 Jul 7, 2024
b37ee04
RemoteConfig 추가
eastshine2741 Jul 7, 2024
2a93aea
Timetable 추가
eastshine2741 Jul 7, 2024
5389721
TimeTableTrimConfig 추가
eastshine2741 Jul 7, 2024
07b9871
Tag 추가
eastshine2741 Jul 7, 2024
232186b
Popup 추가
eastshine2741 Jul 7, 2024
f415c19
ThemeMode 추가
eastshine2741 Jul 7, 2024
a47262d
Merge remote-tracking branch 'refs/remotes/origin/refactor/multi-modu…
plgafhd Jul 7, 2024
abb562a
Lecture 모델 논의 후 변경
plgafhd Jul 13, 2024
13d4225
core:model Time
JuTaK97 Jul 20, 2024
93f5854
core:moel Day
JuTaK97 Jul 20, 2024
28d6b97
core:model TimetableBlock
JuTaK97 Jul 20, 2024
87422e5
core:model PlaceTime
JuTaK97 Jul 20, 2024
e57f866
core:model Campus
JuTaK97 Jul 20, 2024
fd4178f
core:model GeoCoordinate
JuTaK97 Jul 20, 2024
dca0bc8
core:model LectureColor
JuTaK97 Jul 20, 2024
fad66d7
core:model SimpleTimeTable
JuTaK97 Jul 20, 2024
f8c4a4a
color
JuTaK97 Jul 20, 2024
6221f59
core:model Theme
JuTaK97 Jul 20, 2024
fe6b51a
core:model Timetable
JuTaK97 Jul 20, 2024
fd06313
core:model SimpleTimetable
JuTaK97 Jul 20, 2024
a5098ed
core:model TimetableTrimConfig
JuTaK97 Jul 20, 2024
1c22719
core:model Lecture
JuTaK97 Jul 20, 2024
8392a09
core:model User
JuTaK97 Jul 20, 2024
1ff031c
core:model Notification
JuTaK97 Jul 20, 2024
4c4cc09
remove unused Place
JuTaK97 Jul 20, 2024
f936697
Merge branch 'refactor/multi-module-base-branch' into eastshine2741/c…
JuTaK97 Jul 20, 2024
ca16cdf
chore: lint
JuTaK97 Jul 20, 2024
f2b5e67
core:model Lecture에 equals, hashCode 오버라이드 추가
JuTaK97 Jul 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,60 @@ abstract class Lecture(
if (lectureNumber == null) return false
return isCourseNumberEquals(lecture) && lectureNumber == lecture.lectureNumber
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
} else if (other !is Lecture) {
return false
} else {
return if (id != other.id) {
false
} else if (originalLectureId != other.originalLectureId) {
false
} else if (title != other.title) {
false
} else if (instructor != other.instructor) {
false
} else if (department != other.department) {
false
} else if (academicYear != other.academicYear) {
false
} else if (credit != other.credit) {
false
} else if (classification != other.classification) {
false
} else if (category != other.category) {
false
} else if (courseNumber != other.courseNumber) {
false
} else if (lectureNumber != other.lectureNumber) {
false
} else if (quota != other.quota) {
false
} else if (freshmanQuota != other.freshmanQuota) {
false
} else if (remark != other.remark) {
false
} else if (placeTimes.toSet() != other.placeTimes.toSet()) {
false
} else if (color != other.color) {
false
} else if (registrationCount != other.registrationCount) {
false
} else {
wasFull != other.wasFull
}
}
}

override fun hashCode(): Int {
return listOf(
id, originalLectureId, title, instructor, department,
academicYear, credit, classification, category, courseNumber, lectureNumber,
quota, freshmanQuota, remark, placeTimes, color, registrationCount, wasFull,
).fold(0) { current, value ->
current * 31 + (value?.hashCode() ?: 0)
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

헉 이런 방법이