org.zanata.rest.dto.GlossaryResults Maven / Gradle / Ivy
package org.zanata.rest.dto;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
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 [email protected]
*/
@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 glossaryEntries;
private List warnings;
public GlossaryResults() {
}
public GlossaryResults(List glossaryEntries, List 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 getGlossaryEntries() {
if (glossaryEntries == null) {
glossaryEntries = new ArrayList();
}
return glossaryEntries;
}
/**
* A list of warnings generated when performing the operation
*/
@JsonProperty("warnings")
@XmlElementWrapper(name = "warnings", namespace = Namespaces.ZANATA_API)
public List getWarnings() {
if (warnings == null) {
warnings = new ArrayList();
}
return warnings;
}
public void setGlossaryEntries(List glossaryEntries) {
this.glossaryEntries = glossaryEntries;
}
public void setWarnings(List warnings) {
this.warnings = warnings;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy