From 5ed74d18d8a8306a50468966455ab883dddb887a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 11 Dec 2023 10:04:06 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A1=E3=82=BF=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E5=AE=9A=E7=BE=A9=E3=82=92=E3=81=A4=E3=81=8F=E3=81=A3?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/data/model/documents/Meta.java | 98 ++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/data/src/main/java/one/nem/lacerta/data/model/documents/Meta.java b/data/src/main/java/one/nem/lacerta/data/model/documents/Meta.java index 9e7b14be..34b4c36c 100644 --- a/data/src/main/java/one/nem/lacerta/data/model/documents/Meta.java +++ b/data/src/main/java/one/nem/lacerta/data/model/documents/Meta.java @@ -1,7 +1,103 @@ package one.nem.lacerta.data.model.documents; +import one.nem.lacerta.data.model.documents.enums.DocumentType; public class Meta { // ドキュメントのメタ情報 public String id; // ドキュメントの内部ID(UUIDv4?) - public + public String name; // ドキュメントの名前 + public String description; // ドキュメントの説明 + public DocumentType type; // ドキュメントの種類 + public String[] tags; // ドキュメントのタグ + public String[] categories; // ドキュメントのカテゴリ + + public Meta(String id, String name, String description, DocumentType type, String[] tags, String[] categories) { + this.id = id; + this.name = name; + this.description = description; + this.type = type; + this.tags = tags; + this.categories = categories; + } + + public Meta() { + this.id = ""; + this.name = ""; + this.description = ""; + this.type = DocumentType.OTHER; + this.tags = new String[0]; + this.categories = new String[0]; + } + + // TODO-rca: ボイラープレートコードなので削減する + // Getter + + public String getId() { + return id; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public DocumentType getType() { + return type; + } + + public String[] getTags() { + return tags; + } + + public String[] getCategories() { + return categories; + } + + // Setter + + public void setId(String id) { + this.id = id; + } + + public void setName(String name) { + if (name == null) { + this.name = ""; + } else { + this.name = name; + } + } + + public void setDescription(String description) { + if (description == null) { + this.description = ""; + } else { + this.description = description; + } + } + + public void setType(DocumentType type) { + if (type == null) { + this.type = DocumentType.OTHER; + } else { + this.type = type; + } + } + + public void setTags(String[] tags) { + if (tags == null) { + this.tags = new String[0]; + } else { + this.tags = tags; + } + } + + public void setCategories(String[] categories) { + if (categories == null) { + this.categories = new String[0]; + } else { + this.categories = categories; + } + } }