-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemoVO.java
More file actions
64 lines (49 loc) · 1.54 KB
/
MemoVO.java
File metadata and controls
64 lines (49 loc) · 1.54 KB
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
package memo;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
public class MemoVO {
//변수
// private static int memoNum; //입력할 글번호????? >글번호 증가할 때 사용할 변수..?
private int no; //특정메모의 글번호 ????>인덱스 넘버..?
private String name;
private String password;
private String content;
private String memoDate;//임시
public MemoVO(String name, String password, String content){
this.no = MemoList.memoNum++; // 1씩 증가
this.name = name;
this.password = password;
this.content = content;
this.memoDate = setConstructTime();
}
// Only for MemoList.updateMemo() method
public MemoVO(int contentNum, String name, String password, String content){
this.no = contentNum;
this.name = name;
this.password = password;
this.content = content;
this.memoDate = setConstructTime();
}
private String setConstructTime() {
LocalDateTime date = LocalDateTime.now();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd/HH:mm:ss");
return dtf.format(date);
}
// getter
public int getNo() {
return no;
}
public String getName() {
return name;
}
public String getPassword() {
return password;
}
public String getContent() {
return content;
}
public String getMemodate() {
return memoDate;
}
}