View Javadoc
1   /*
2    * Copyright 2010 The Kuali Foundation 
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.osedu.org/licenses/ECL-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13   * implied. See the License for the specific language governing
14   * permissions and limitations under the License.
15   */
16  
17  package org.kuali.student.r2.common.dto;
18  
19  import org.kuali.student.r2.common.infc.Status;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlAnyElement;
24  import javax.xml.bind.annotation.XmlElement;
25  import javax.xml.bind.annotation.XmlType;
26  import java.io.Serializable;
27  import java.util.List;
28  //import org.w3c.dom.Element;
29  
30  /**
31   * Information about the state of an object
32   * 
33   * @author nwright
34   */
35  
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "StatusInfo", propOrder = {"isSuccess", "message" , "_futureElements" }) 
38  
39  public class StatusInfo 
40      implements Status, Serializable {
41  
42      private static final long serialVersionUID = 1L;
43  	
44      @XmlElement
45      private Boolean isSuccess;
46      
47      @XmlElement
48      private String message;
49      
50      @XmlAnyElement
51      private List<Object> _futureElements;  	
52  
53      
54      /**
55       * Constructs a new StatusInfo.
56       */
57      public StatusInfo() {
58          isSuccess = Boolean.valueOf(true);
59          message = "";
60      }
61  	
62      /**
63       * Constructs a new StatusInfo from another Status.
64       *
65       * @param status the Status to copy
66       */
67      public StatusInfo(Status status) {
68          this.isSuccess = status.getIsSuccess();
69          this.message = status.getMessage();
70      }
71  
72      @Override
73      public Boolean getIsSuccess(){
74          return isSuccess;
75      }
76      
77      public void setSuccess(Boolean success) {
78          this.isSuccess = success;
79      }
80      
81      @Override
82      public String getMessage() {
83          return message;
84      }
85      
86      public void setMessage(String message) {
87          this.message = message;
88      }
89  
90      @Override
91      public String toString() {
92          return "StatusInfo{" +
93                  "isSuccess=" + isSuccess +
94                  ", message='" + message + '\'' +
95                  '}';
96      }
97  }