From c875ba5e54526eafcf1c37d658d4ff05091321be Mon Sep 17 00:00:00 2001 From: r-ca Date: Sat, 16 Dec 2023 13:40:08 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=B3=E3=82=B9=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=AF=E3=82=BF=E3=81=AE=E7=A8=AE=E9=A1=9E=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/model/document/DocumentMeta.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java index 0a87aa6d..5d87f692 100644 --- a/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java +++ b/model/src/main/java/one/nem/lacerta/model/document/DocumentMeta.java @@ -9,8 +9,6 @@ import java.util.List; * ドキュメントのメタデータ */ public class DocumentMeta { - // TODO-rca: 作成日時なしでインスタンス化できるようにする? - /** * ドキュメントのID(String) */ @@ -36,6 +34,31 @@ public class DocumentMeta { */ List tags; + // Constructor + public DocumentMeta() { + } + + public DocumentMeta(String id, String title, Date updatedAt, Date createdAt, List 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 tags) { this.tags = tags; } + }