diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/Annotation.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/Annotation.java index 725967353f5685e93c53302b7a8a0e799e4ccc12..699ec3eda8ad469fda08b6688311fabb9a17bc5b 100644 --- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/Annotation.java +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/Annotation.java @@ -9,21 +9,17 @@ public class Annotation { // variables private String id; private long timestamp; - private int userId; + private String userToken; private int targetId; - private String body; - private int startCharacter; - private int endCharacter; + private AnnotationBody body; // constructor - public Annotation(String id, long timestamp, int userId, int targetId, String body, int startCharacter, int endCharacter) { + public Annotation(String id, long timestamp, String userToken, int targetId, AnnotationBody body) { this.id = id; this.timestamp = timestamp; - this.userId = userId; + this.userToken = userToken; this.targetId = targetId; this.body = body; - this.startCharacter = startCharacter; - this.endCharacter = endCharacter; } // methods @@ -43,12 +39,12 @@ public class Annotation { this.timestamp = timestamp; } - public int getUserId() { - return userId; + public String getUserToken() { + return userToken; } - public void setUserId(int userId) { - this.userId = userId; + public void setUserToken(String userToken) { + this.userToken = userToken; } public int getTargetId() { @@ -59,40 +55,22 @@ public class Annotation { this.targetId = targetId; } - public String getBody() { + public AnnotationBody getBody() { return body; } - public void setBody(String body) { + public void setBody(AnnotationBody body) { this.body = body; } - public int getStartCharacter() { - return startCharacter; - } - - public void setStartCharacter(int startCharacter) { - this.startCharacter = startCharacter; - } - - public int getEndCharacter() { - return endCharacter; - } - - public void setEndCharacter(int endCharacter) { - this.endCharacter = endCharacter; - } - @Override public String toString() { return "Annotation{" + - "id=" + id + + "id='" + id + '\'' + ", timestamp=" + timestamp + - ", userId=" + userId + + ", userToken='" + userToken + '\'' + ", targetId=" + targetId + - ", body='" + body + '\'' + - ", startCharacter=" + startCharacter + - ", endCharacter=" + endCharacter + + ", body=" + body + '}'; } diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/AnnotationBody.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/AnnotationBody.java new file mode 100644 index 0000000000000000000000000000000000000000..7db2de1f2a5ed3c7888fd595af8441cddbbf9cca --- /dev/null +++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/annotation/model/AnnotationBody.java @@ -0,0 +1,66 @@ +package unipotsdam.gf.modules.annotation.model; + +/** + * @author Sven Kästle + * skaestle@uni-potsdam.de + */ +public class AnnotationBody { + + // variables + private String title; + private String comment; + private int startCharacter; + private int endCharacter; + + // constructor + public AnnotationBody(String title, String comment, int startCharacter, int endCharacter) { + this.title = title; + this.comment = comment; + this.startCharacter = startCharacter; + this.endCharacter = endCharacter; + } + + // methods + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getComment() { + return comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public int getStartCharacter() { + return startCharacter; + } + + public void setStartCharacter(int startCharacter) { + this.startCharacter = startCharacter; + } + + public int getEndCharacter() { + return endCharacter; + } + + public void setEndCharacter(int endCharacter) { + this.endCharacter = endCharacter; + } + + @Override + public String toString() { + return "AnnotationBody{" + + "title='" + title + '\'' + + ", comment='" + comment + '\'' + + ", startCharacter=" + startCharacter + + ", endCharacter=" + endCharacter + + '}'; + } + +}