コンストラクタの種類を追加

This commit is contained in:
r-ca 2023-12-16 13:40:08 +09:00
parent c297fb043a
commit c875ba5e54
No known key found for this signature in database
GPG Key ID: 6A72911AC73464A9

View File

@ -9,8 +9,6 @@ import java.util.List;
* ドキュメントのメタデータ
*/
public class DocumentMeta {
// TODO-rca: 作成日時なしでインスタンス化できるようにする
/**
* ドキュメントのID(String)
*/
@ -36,6 +34,31 @@ public class DocumentMeta {
*/
List<DocumentTag> tags;
// Constructor
public DocumentMeta() {
}
public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List<DocumentTag> tags) { // With all
this.id = id;
this.title = title;
this.updatedAt = updatedAt;
this.createdAt = createdAt;
this.tags = tags;
}
public DocumentMeta(String id, String title, Date updatedAt, Date createdAt) { // Without tags
this.id = id;
this.title = title;
this.updatedAt = updatedAt;
this.createdAt = createdAt;
this.tags = new ArrayList<>();
}
public DocumentMeta(String id, String title) { // Without tags, updatedAt, createdAt
this.id = id;
this.title = title;
}
// Getter
/**
@ -125,4 +148,5 @@ public class DocumentMeta {
public void setTags(List<DocumentTag> tags) {
this.tags = tags;
}
}