1 | package clarin.cmdi.componentregistry.model; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.List; |
---|
5 | |
---|
6 | import javax.xml.bind.annotation.XmlAccessType; |
---|
7 | import javax.xml.bind.annotation.XmlAccessorType; |
---|
8 | import javax.xml.bind.annotation.XmlAttribute; |
---|
9 | import javax.xml.bind.annotation.XmlElement; |
---|
10 | import javax.xml.bind.annotation.XmlElementWrapper; |
---|
11 | import javax.xml.bind.annotation.XmlElements; |
---|
12 | import javax.xml.bind.annotation.XmlRootElement; |
---|
13 | import javax.xml.bind.annotation.XmlSeeAlso; |
---|
14 | import javax.xml.bind.annotation.XmlType; |
---|
15 | |
---|
16 | /** |
---|
17 | * |
---|
18 | * @author jeafer |
---|
19 | */ |
---|
20 | @XmlRootElement(name = "response") |
---|
21 | @XmlAccessorType(XmlAccessType.FIELD) |
---|
22 | @XmlSeeAlso({RegisterResponse.class, CommentResponse.class}) |
---|
23 | @XmlType(propOrder = {"registered","isPrivate","errors"}) |
---|
24 | public class ComponentRegistryResponse { |
---|
25 | |
---|
26 | @XmlAttribute(required = true) |
---|
27 | private Boolean registered; |
---|
28 | |
---|
29 | @XmlAttribute(required = true) |
---|
30 | private Boolean isPrivate; |
---|
31 | |
---|
32 | @XmlElementWrapper(name = "errors", required = false) |
---|
33 | @XmlElements( |
---|
34 | @XmlElement(name = "error", type = String.class)) |
---|
35 | private List<String> errors = new ArrayList<String>(); |
---|
36 | |
---|
37 | public ComponentRegistryResponse() { |
---|
38 | } |
---|
39 | |
---|
40 | public void addError(String error) { |
---|
41 | getErrors().add(error); |
---|
42 | } |
---|
43 | |
---|
44 | public List<String> getErrors() { |
---|
45 | return errors; |
---|
46 | } |
---|
47 | |
---|
48 | public boolean isRegistered() { |
---|
49 | return registered; |
---|
50 | } |
---|
51 | |
---|
52 | public void setErrors(List<String> errors) { |
---|
53 | this.errors = errors; |
---|
54 | } |
---|
55 | |
---|
56 | public void setRegistered(boolean registered) { |
---|
57 | this.registered = registered; |
---|
58 | } |
---|
59 | |
---|
60 | public void setIsPrivate(Boolean isPrivate) { |
---|
61 | this.isPrivate = isPrivate; |
---|
62 | } |
---|
63 | |
---|
64 | public Boolean isPrivate() { |
---|
65 | return isPrivate; |
---|
66 | } |
---|
67 | } |
---|