-
Notifications
You must be signed in to change notification settings - Fork 291
/
Copy pathCourse.java
49 lines (39 loc) · 1.32 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
package nextstep.courses.domain;
import nextstep.common.domain.BaseEntity;
import nextstep.courses.domain.session.Session;
import java.time.LocalDateTime;
import java.util.List;
public class Course extends BaseEntity {
private Long id;
private String title;
private Long creatorId;
private List<Session> sessions;
public Course(String title, Long creatorId) {
this(0L, title, creatorId, LocalDateTime.now(), null, null);
}
public Course(Long id, String title, Long creatorId, LocalDateTime createdAt, LocalDateTime updatedAt) {
this(0L, title, creatorId, createdAt, updatedAt, null);
}
public Course(Long id, String title, Long creatorId, LocalDateTime createdAt, LocalDateTime updatedAt, List<Session> sessions) {
super(id, createdAt, updatedAt);
this.title = title;
this.creatorId = creatorId;
this.sessions = sessions;
}
public String getTitle() {
return title;
}
public Long getCreatorId() {
return creatorId;
}
@Override
public String toString() {
return "Course{" +
"id=" + id +
", title='" + title + '\'' +
", creatorId=" + creatorId +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
'}';
}
}