| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 1 | package de.ids_mannheim.korap.dto; |
| 2 | |
| 3 | import java.util.List; |
| 4 | import java.util.Map; |
| margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame^] | 5 | import java.util.Set; |
| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 6 | |
| margaretha | 51e5e3f | 2018-10-17 15:10:03 +0200 | [diff] [blame] | 7 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
| 8 | import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; |
| 9 | |
| 10 | import com.fasterxml.jackson.annotation.JsonInclude; |
| 11 | import com.fasterxml.jackson.annotation.JsonInclude.Include; |
| 12 | |
| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 13 | import lombok.Getter; |
| 14 | import 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 |
| margaretha | 51e5e3f | 2018-10-17 15:10:03 +0200 | [diff] [blame] | 25 | @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 |
| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 27 | public class FoundryDto { |
| 28 | |
| 29 | private String code; |
| 30 | private String description; |
| 31 | private List<Layer> layers; |
| 32 | |
| 33 | @Getter |
| 34 | @Setter |
| margaretha | 51e5e3f | 2018-10-17 15:10:03 +0200 | [diff] [blame] | 35 | @JsonInclude(Include.NON_EMPTY) |
| 36 | @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey |
| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 37 | public class Layer { |
| 38 | private String code; |
| 39 | private String description; |
| margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame^] | 40 | private Set<Key> keys; |
| margaretha | 51e5e3f | 2018-10-17 15:10:03 +0200 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | @Getter |
| 44 | @Setter |
| 45 | @JsonInclude(Include.NON_EMPTY) |
| 46 | @JsonSerialize(include=Inclusion.NON_EMPTY) // old codehouse annotation used by jersey |
| margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame^] | 47 | public class Key implements Comparable<Key>{ |
| margaretha | 51e5e3f | 2018-10-17 15:10:03 +0200 | [diff] [blame] | 48 | |
| 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 | } |
| margaretha | 3da7cd3 | 2018-10-22 17:42:52 +0200 | [diff] [blame^] | 56 | |
| 57 | @Override |
| 58 | public int compareTo (Key k) { |
| 59 | return this.code.compareTo(k.code); |
| 60 | } |
| margaretha | 50179c8 | 2017-07-20 15:36:05 +0200 | [diff] [blame] | 61 | } |
| 62 | } |