mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
コンストラクタ変更
This commit is contained in:
parent
8f0f95d8af
commit
b63e2dd862
|
@ -44,41 +44,24 @@ public class DocumentMeta {
|
||||||
String defaultBranch;
|
String defaultBranch;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
|
|
||||||
public DocumentMeta() {
|
public DocumentMeta() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List<DocumentTag> tags) { // With all
|
public DocumentMeta(String title, List<DocumentTag> tags, String author, String defaultBranch) {
|
||||||
this.id = id;
|
this.id = UUID.randomUUID().toString();
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.updatedAt = updatedAt;
|
|
||||||
this.createdAt = createdAt;
|
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
|
this.author = author;
|
||||||
|
this.defaultBranch = defaultBranch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DocumentMeta(String id, String title, Date updatedAt, Date createdAt) { // Without tags
|
public DocumentMeta(String id, String title, List<DocumentTag> tags, String author, String defaultBranch) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.updatedAt = updatedAt;
|
this.tags = tags;
|
||||||
this.createdAt = createdAt;
|
this.author = author;
|
||||||
this.tags = new ArrayList<>();
|
this.defaultBranch = defaultBranch;
|
||||||
}
|
|
||||||
|
|
||||||
public DocumentMeta(String id, String title) { // Without tags, updatedAt, createdAt
|
|
||||||
this.id = id;
|
|
||||||
this.title = title;
|
|
||||||
// 現在時刻を設定
|
|
||||||
this.updatedAt = new Date();
|
|
||||||
this.createdAt = new Date();
|
|
||||||
this.tags = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public DocumentMeta(String title) { // title only
|
|
||||||
this.id = UUID.randomUUID().toString(); // 新規作成時想定なのでコンストラクタで生成してしまう(使う人が楽なので)
|
|
||||||
this.title = title;
|
|
||||||
// 現在時刻を設定
|
|
||||||
this.updatedAt = new Date();
|
|
||||||
this.createdAt = new Date();
|
|
||||||
this.tags = new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getter
|
// Getter
|
||||||
|
|
Loading…
Reference in New Issue
Block a user