blob: 26cf38370497e38487e7c12a1fceb303732661e1 [file] [log] [blame]
margaretha50179c82017-07-20 15:36:05 +02001package de.ids_mannheim.korap.dto;
2
3import java.util.List;
4import java.util.Map;
margaretha3da7cd32018-10-22 17:42:52 +02005import java.util.Set;
margaretha50179c82017-07-20 15:36:05 +02006
margaretha51e5e3f2018-10-17 15:10:03 +02007import org.codehaus.jackson.map.annotate.JsonSerialize;
8import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
9
10import com.fasterxml.jackson.annotation.JsonInclude;
11import com.fasterxml.jackson.annotation.JsonInclude.Include;
12
margaretha50179c82017-07-20 15:36:05 +020013import lombok.Getter;
14import lombok.Setter;
15
16/**
17 * Data transfer object for annotation descriptions (e.g. for
18 * Kalamar).
19 *
20 * @author margaretha
21 *
22 */
23@Getter
24@Setter
margaretha51e5e3f2018-10-17 15:10:03 +020025@JsonInclude(Include.NON_EMPTY) // new fasterxml annotation, not used by current jersey version
26@JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation, used by jersey
margaretha50179c82017-07-20 15:36:05 +020027public class FoundryDto {
28
29 private String code;
30 private String description;
31 private List<Layer> layers;
32
33 @Getter
34 @Setter
margaretha51e5e3f2018-10-17 15:10:03 +020035 @JsonInclude(Include.NON_EMPTY)
36 @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
margaretha50179c82017-07-20 15:36:05 +020037 public class Layer {
38 private String code;
39 private String description;
margaretha3da7cd32018-10-22 17:42:52 +020040 private Set<Key> keys;
margaretha51e5e3f2018-10-17 15:10:03 +020041 }
42
43 @Getter
44 @Setter
45 @JsonInclude(Include.NON_EMPTY)
46 @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey
margaretha3da7cd32018-10-22 17:42:52 +020047 public class Key implements Comparable<Key>{
margaretha51e5e3f2018-10-17 15:10:03 +020048
49 private String code;
50 private String description;
51 private Map<String, String> values;
52
53 public Key (String code) {
54 this.code = code;
55 }
margaretha3da7cd32018-10-22 17:42:52 +020056
57 @Override
58 public int compareTo (Key k) {
59 return this.code.compareTo(k.code);
60 }
margaretha50179c82017-07-20 15:36:05 +020061 }
62}