-
Notifications
You must be signed in to change notification settings - Fork 248
/
Copy pathSessionImage.java
54 lines (38 loc) · 1.37 KB
/
SessionImage.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
package nextstep.courses.domain.image;
import nextstep.courses.common.SystemTimeStamp;
import nextstep.courses.domain.session.Session;
import java.time.LocalDateTime;
public class SessionImage {
private long id;
private String name;
private long sessionId;
private ImageFormat imageFormat;
private SystemTimeStamp systemTimeStamp;
public static SessionImage valueOf(long id, Session session, int size, int width, int height, String imageType) {
return new SessionImage(id, "tmp", session.getId()
, new ImageFormat(size, width, height, ImageType.validateImageType(imageType))
, new SystemTimeStamp(LocalDateTime.now(), null));
}
public SessionImage(long id, String name, long sessionId, ImageFormat imageFormat, SystemTimeStamp systemTimeStamp) {
this.id = id;
this.name = name;
this.sessionId = sessionId;
this.imageFormat = imageFormat;
this.systemTimeStamp = systemTimeStamp;
}
public String getName() {
return name;
}
public long getSessionId() {
return sessionId;
}
public ImageFormat getImageFormat() {
return imageFormat;
}
public LocalDateTime getCreatedAt() {
return systemTimeStamp.getCreatedAt();
}
public LocalDateTime getUpdatedAt() {
return systemTimeStamp.getCreatedAt();
}
}