aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/com/terminaldweller/doc/Doc.java
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-05-03 10:28:42 +0000
committerterminaldweller <thabogre@gmail.com>2022-05-03 10:28:42 +0000
commit056dcb5b4fda70f963bfb392fcd2816170f2bc12 (patch)
treecf79d8f2ef8cbfe574d59b9d785dbb52496aff4d /src/main/java/com/terminaldweller/doc/Doc.java
parentupdate (diff)
downloadmdrtl-056dcb5b4fda70f963bfb392fcd2816170f2bc12.tar.gz
mdrtl-056dcb5b4fda70f963bfb392fcd2816170f2bc12.zip
added PUT, the CRUD is done now. just need to test the crud
Diffstat (limited to 'src/main/java/com/terminaldweller/doc/Doc.java')
-rw-r--r--src/main/java/com/terminaldweller/doc/Doc.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/main/java/com/terminaldweller/doc/Doc.java b/src/main/java/com/terminaldweller/doc/Doc.java
index 1ec9dca..c3fa72b 100644
--- a/src/main/java/com/terminaldweller/doc/Doc.java
+++ b/src/main/java/com/terminaldweller/doc/Doc.java
@@ -18,6 +18,7 @@ public class Doc {
private String name;
private long lastModified;
+ private String body;
public Doc() {}
@@ -28,15 +29,24 @@ public class Doc {
* @param name the name of the documment given by the user.
* @param lastModified the date of the last modification in unix epoch.
*/
- public Doc(Long id, String name, long lastModified) {
+ public Doc(Long id, String name, long lastModified, String body) {
this.id = id;
this.name = name;
this.lastModified = lastModified;
+ this.body = body;
}
- public Doc(String name, long lastModified) {
+ /**
+ * Constructor without the id.
+ *
+ * @param name document name
+ * @param lastModified date of last modification
+ * @param body document content
+ */
+ public Doc(String name, long lastModified, String body) {
this.name = name;
this.lastModified = lastModified;
+ this.body = body;
}
public Long getId() {
@@ -51,6 +61,10 @@ public class Doc {
return this.lastModified;
}
+ public String getBody() {
+ return this.body;
+ }
+
public void setId(Long id) {
this.id = id;
}
@@ -62,4 +76,8 @@ public class Doc {
public void setLastModified(long lastModified) {
this.lastModified = lastModified;
}
+
+ public void setBody(String body) {
+ this.body = body;
+ }
}