1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.student.r2.common.dto;
18
19 import java.io.Serializable;
20 import java.util.ArrayList;
21 import java.util.List;
22
23 import javax.xml.bind.annotation.XmlAccessType;
24 import javax.xml.bind.annotation.XmlAccessorType;
25 import javax.xml.bind.annotation.XmlAnyElement;
26 import javax.xml.bind.annotation.XmlElement;
27 import javax.xml.bind.annotation.XmlType;
28
29 import org.kuali.student.r2.common.infc.OperationStatus;
30
31
32 @XmlAccessorType(XmlAccessType.FIELD)
33 @XmlType(name = "OperationStatusInfo", propOrder = {
34 "status", "messages", "warnings", "errors" , "_futureElements" })
35
36 public class OperationStatusInfo
37 implements OperationStatus, Serializable {
38
39 private static final long serialVersionUID = 1L;
40
41 @XmlElement
42 private String status;
43
44 @XmlElement
45 private List<String> messages;
46
47 @XmlElement
48 private List<String> warnings;
49
50 @XmlElement
51 private List<String> errors;
52
53 @XmlAnyElement
54 private List<Object> _futureElements;
55
56
57
58
59
60 public OperationStatusInfo() {
61 }
62
63
64
65
66
67
68
69 public OperationStatusInfo (OperationStatus status) {
70 if (status != null) {
71 this.status = status.getStatus();
72 if (status.getMessages() != null) {
73 this.messages = new ArrayList(status.getMessages());
74 }
75
76 if (status.getWarnings() != null) {
77 this.warnings = new ArrayList(status.getWarnings());
78 }
79
80 if (status.getErrors() != null) {
81 this.errors = new ArrayList(status.getErrors());
82 }
83 }
84 }
85
86 @Override
87 public String getStatus() {
88 return status;
89 }
90
91 public void setStatus(String status) {
92 this.status = status;
93 }
94
95 @Override
96 public List<String> getMessages() {
97 if (messages == null) {
98 messages = new ArrayList<String>(0);
99 }
100
101 return messages;
102 }
103
104 public void setMessages(List<String> messages) {
105 this.messages = messages;
106 }
107
108 @Override
109 public List<String> getWarnings() {
110 if (warnings == null) {
111 warnings = new ArrayList<String>(0);
112 }
113
114 return warnings;
115 }
116
117 public void setWarnings(List<String> warnings) {
118 this.warnings = warnings;
119 }
120
121 @Override
122 public List<String> getErrors() {
123 if (errors == null) {
124 errors = new ArrayList<String>(0);
125 }
126
127 return errors;
128 }
129
130 public void setErrors(List<String> errors) {
131 this.errors = errors;
132 }
133 }