Coverage Report - org.kuali.student.r2.common.dto.OperationStatusInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
OperationStatusInfo
0%
0/30
0%
0/14
1.7
 
 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 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  
 import org.w3c.dom.Element;
 31  
 
 32  
 @XmlAccessorType(XmlAccessType.FIELD)
 33  
 @XmlType(name = "OperationStatusInfo", propOrder = {
 34  
                 "status", "messages", "warnings", "errors", 
 35  
                 "_futureElements"})
 36  
 
 37  
 public class OperationStatusInfo 
 38  
     implements OperationStatus, Serializable {
 39  
 
 40  
     private static final long serialVersionUID = 1L;
 41  
 
 42  
     @XmlElement
 43  
     private String status;
 44  
 
 45  
     @XmlElement
 46  
     private List<String> messages;
 47  
 
 48  
     @XmlElement
 49  
     private List<String> warnings;
 50  
 
 51  
     @XmlElement
 52  
     private List<String> errors;
 53  
 
 54  
     @XmlAnyElement
 55  
     private List<Element> _futureElements;
 56  
 
 57  
 
 58  
     /**
 59  
      * Constructs a new OperationStatusInfo.
 60  
      */
 61  0
     public OperationStatusInfo() {
 62  0
     }
 63  
     
 64  
     /**
 65  
      * Constructs a new OperationStatusInfo from another
 66  
      * OperationStatus.
 67  
      *
 68  
      * @param status the OperationStatus to copy
 69  
      */
 70  0
     public OperationStatusInfo (OperationStatus status) {
 71  0
         if (status != null) {
 72  0
             this.status = status.getStatus();
 73  0
             if (status.getMessages() != null) {
 74  0
                 this.messages = new ArrayList(status.getMessages());
 75  
             }
 76  
 
 77  0
             if (status.getWarnings() != null) {
 78  0
                 this.warnings = new ArrayList(status.getWarnings());
 79  
             }
 80  
 
 81  0
             if (status.getErrors() != null) {
 82  0
                 this.errors = new ArrayList(status.getErrors());
 83  
             }
 84  
         }
 85  0
     }
 86  
 
 87  
     @Override
 88  
     public String getStatus() {
 89  0
         return status;
 90  
     }
 91  
 
 92  
     public void setStatus(String status) {
 93  0
         this.status = status;
 94  0
     }
 95  
 
 96  
     @Override
 97  
     public List<String> getMessages() {
 98  0
         if (messages == null) {
 99  0
             messages = new ArrayList<String>(0);
 100  
         }
 101  
 
 102  0
         return messages;
 103  
     }
 104  
 
 105  
     public void setMessages(List<String> messages) {
 106  0
         this.messages = messages;
 107  0
     }
 108  
     
 109  
     @Override
 110  
     public List<String> getWarnings() {
 111  0
         if (warnings == null) {
 112  0
             warnings = new ArrayList<String>(0);
 113  
         }
 114  
 
 115  0
         return warnings;
 116  
     }
 117  
 
 118  
     public void setWarnings(List<String> warnings) {
 119  0
         this.warnings = warnings;
 120  0
     }
 121  
 
 122  
     @Override
 123  
     public List<String> getErrors() {
 124  0
         if (errors == null) {
 125  0
             errors = new ArrayList<String>(0);
 126  
         }
 127  
 
 128  0
         return errors;
 129  
     }
 130  
 
 131  
     public void setErrors(List<String> errors) {
 132  0
         this.errors = errors;
 133  0
     }
 134  
 }