-
Notifications
You must be signed in to change notification settings - Fork 248
/
Copy pathCourse.java
78 lines (60 loc) · 1.93 KB
/
Course.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package nextstep.courses.domain;
import nextstep.sessions.domain.Session;
import nextstep.sessions.domain.Sessions;
import java.time.LocalDateTime;
import java.util.List;
public class Course {
private Long id;
private String title;
private Long creatorId;
private int cardinalNumber;
private Sessions sessions;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
public Course() {
}
public Course(String title, Long creatorId) {
this(0L, title, creatorId, 1, null, LocalDateTime.now(), null);
}
public Course(Long id, String title, Long creatorId, int cardinalNumber, Sessions sessions,
LocalDateTime createdAt, LocalDateTime updatedAt) {
this.id = id;
this.title = title;
this.creatorId = creatorId;
this.cardinalNumber = cardinalNumber;
this.sessions = sessions;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public Course(Long id, String title, Long creatorId, LocalDateTime createdAt, LocalDateTime updatedAt) {
this.id = id;
this.title = title;
this.creatorId = creatorId;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public String getTitle() {
return title;
}
public Long getCreatorId() {
return creatorId;
}
public LocalDateTime getCreatedAt() {
return createdAt;
}
public List<Session> getPossibleSessionList() {
return this.sessions.getPossibleSessionList();
}
@Override
public String toString() {
return "Course{" +
"id=" + id +
", title='" + title + '\'' +
", creatorId=" + creatorId +
", cardinalNumber=" + cardinalNumber +
", sessions=" + sessions +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
'}';
}
}