1 package de.dlr.shepard.mongoDB;
2
3 import java.util.Date;
4
5 import org.bson.Document;
6 import org.neo4j.ogm.annotation.NodeEntity;
7
8 import io.swagger.v3.oas.annotations.media.Schema;
9 import lombok.Data;
10 import lombok.EqualsAndHashCode;
11 import lombok.NoArgsConstructor;
12 import lombok.ToString;
13
14 @NodeEntity
15 @Data
16 @EqualsAndHashCode(callSuper = true)
17 @ToString(callSuper = true)
18 @NoArgsConstructor
19 public class StructuredData extends AbstractMongoObject {
20
21 @Schema(nullable = true)
22 private String name;
23
24 public StructuredData(String name, Date createdAt) {
25 setCreatedAt(createdAt);
26 this.name = name;
27 }
28
29 public StructuredData(String oid, Date createdAt, String name) {
30 super(oid, createdAt);
31 this.name = name;
32 }
33
34
35
36
37
38
39 public StructuredData(Document doc) {
40 super(doc.getString("oid"), doc.getDate("createdAt"));
41 this.name = doc.getString("name");
42 }
43 }