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" })
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
54
55
56
57
58
59
60
61 public OperationStatusInfo() {
62 }
63
64
65
66
67
68
69
70 public OperationStatusInfo (OperationStatus status) {
71 if (status != null) {
72 this.status = status.getStatus();
73 if (status.getMessages() != null) {
74 this.messages = new ArrayList(status.getMessages());
75 }
76
77 if (status.getWarnings() != null) {
78 this.warnings = new ArrayList(status.getWarnings());
79 }
80
81 if (status.getErrors() != null) {
82 this.errors = new ArrayList(status.getErrors());
83 }
84 }
85 }
86
87 @Override
88 public String getStatus() {
89 return status;
90 }
91
92 public void setStatus(String status) {
93 this.status = status;
94 }
95
96 @Override
97 public List<String> getMessages() {
98 if (messages == null) {
99 messages = new ArrayList<String>(0);
100 }
101
102 return messages;
103 }
104
105 public void setMessages(List<String> messages) {
106 this.messages = messages;
107 }
108
109 @Override
110 public List<String> getWarnings() {
111 if (warnings == null) {
112 warnings = new ArrayList<String>(0);
113 }
114
115 return warnings;
116 }
117
118 public void setWarnings(List<String> warnings) {
119 this.warnings = warnings;
120 }
121
122 @Override
123 public List<String> getErrors() {
124 if (errors == null) {
125 errors = new ArrayList<String>(0);
126 }
127
128 return errors;
129 }
130
131 public void setErrors(List<String> errors) {
132 this.errors = errors;
133 }
134 }