/
GlossaryResults.java
77 lines (67 loc) · 2.53 KB
/
GlossaryResults.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package org.zanata.rest.dto;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.webcohesion.enunciate.metadata.Label;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.zanata.common.Namespaces;
/**
* Wrapper for list of Glossary entries and a list of warning messages after
* saving/updating
*
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a>
*/
@XmlRootElement(name = "glossaryResults")
@JsonPropertyOrder({ "glossaryEntries", "warnings" })
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@XmlType(name = "glossaryResults", propOrder = {"glossaryEntries", "warnings"})
@Label("Glossary Results")
public class GlossaryResults implements Serializable {
private static final long serialVersionUID = 7100495681284134288L;
private List<GlossaryEntry> glossaryEntries;
private List<String> warnings;
public GlossaryResults() {
}
public GlossaryResults(List<GlossaryEntry> glossaryEntries, List<String> warnings) {
this.glossaryEntries = glossaryEntries;
this.warnings = warnings;
}
/**
* The list of created / updated glossary entries
*/
@JsonProperty("glossaryEntries")
@XmlElementWrapper(name = "glossaryEntries", namespace = Namespaces.ZANATA_API)
@XmlElementRef(namespace = Namespaces.ZANATA_API)
public List<GlossaryEntry> getGlossaryEntries() {
if (glossaryEntries == null) {
glossaryEntries = new ArrayList<GlossaryEntry>();
}
return glossaryEntries;
}
/**
* A list of warnings generated when performing the operation
*/
@JsonProperty("warnings")
@XmlElementWrapper(name = "warnings", namespace = Namespaces.ZANATA_API)
public List<String> getWarnings() {
if (warnings == null) {
warnings = new ArrayList<String>();
}
return warnings;
}
public void setGlossaryEntries(List<GlossaryEntry> glossaryEntries) {
this.glossaryEntries = glossaryEntries;
}
public void setWarnings(List<String> warnings) {
this.warnings = warnings;
}
}