Coverage Report - org.kuali.student.enrollment.batchjobresults.dto.BatchJobResultInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
BatchJobResultInfo
0%
0/36
0%
0/12
1.5
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
 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  
 package org.kuali.student.enrollment.batchjobresults.dto;
 17  
 
 18  
 import java.util.List;
 19  
 
 20  
 import javax.xml.bind.annotation.XmlAccessType;
 21  
 import javax.xml.bind.annotation.XmlAccessorType;
 22  
 import javax.xml.bind.annotation.XmlAnyElement;
 23  
 import javax.xml.bind.annotation.XmlElement;
 24  
 import javax.xml.bind.annotation.XmlType;
 25  
 
 26  
 import org.kuali.student.enrollment.batchjobresults.infc.BatchJobResult;
 27  
 import org.kuali.student.r2.common.dto.AttributeInfo;
 28  
 import org.kuali.student.r2.common.dto.ContextInfo;
 29  
 import org.kuali.student.r2.common.dto.IdEntityInfo;
 30  
 import org.kuali.student.r2.common.dto.RichTextInfo;
 31  
 import org.kuali.student.r2.common.infc.Attribute;
 32  
 import org.w3c.dom.Element;
 33  
 
 34  0
 @XmlAccessorType(XmlAccessType.FIELD)
 35  
 @XmlType(name = "SocInfo", propOrder = {"id",
 36  
     "typeKey",
 37  
     "stateKey",
 38  
     "name",
 39  
     "descr",
 40  
     "parameters",
 41  
     "context",
 42  
     "globalResults",
 43  
     "itemsProcessed",
 44  
     "itemsExpected",
 45  
     "message",
 46  
     "meta",
 47  
     "attributes",
 48  
     "_futureElements"})
 49  
 public class BatchJobResultInfo
 50  
         extends IdEntityInfo
 51  
         implements BatchJobResult {
 52  
 
 53  
     private static final long serialVersionUID = 1L;
 54  
     @XmlElement
 55  
     private List<AttributeInfo> parameters;
 56  
     @XmlElement
 57  
     private ContextInfo context;
 58  
     @XmlElement
 59  
     private List<AttributeInfo> globalResults;
 60  
     @XmlElement
 61  
     private Integer itemsProcessed;
 62  
     @XmlElement
 63  
     private Integer itemsExpected;
 64  
     @XmlElement
 65  
     private RichTextInfo message;
 66  
     @XmlAnyElement
 67  
     private List<Element> _futureElements;
 68  
 
 69  0
     public BatchJobResultInfo() {
 70  0
     }
 71  
 
 72  
     /**
 73  
      * Copies batch job result
 74  
      */
 75  
     public BatchJobResultInfo(BatchJobResult orig) {
 76  
 
 77  0
         super(orig);
 78  
 
 79  0
         if (orig == null) {
 80  0
             return;
 81  
         }
 82  
 
 83  0
         if (orig.getParameters() != null) {
 84  0
             for (Attribute attr : orig.getParameters()) {
 85  0
                 this.getParameters().add(new AttributeInfo(attr));
 86  
             }
 87  
         }
 88  0
         if (orig.getGlobalResults() != null) {
 89  0
             for (Attribute attr : orig.getGlobalResults()) {
 90  0
                 this.getGlobalResults().add(new AttributeInfo(attr));
 91  
             }
 92  
         }
 93  0
         this.context = new ContextInfo(orig.getContext());
 94  0
         this.itemsProcessed = orig.getItemsProcessed();
 95  0
         this.itemsExpected = orig.getItemsExpected();
 96  0
         if (orig.getMessage() != null) {
 97  0
             this.message = new RichTextInfo (orig.getMessage());
 98  
         }
 99  0
     }
 100  
 
 101  
     @Override
 102  
     public ContextInfo getContext() {
 103  0
         return context;
 104  
     }
 105  
 
 106  
     public void setContext(ContextInfo context) {
 107  0
         this.context = context;
 108  0
     }
 109  
 
 110  
     @Override
 111  
     public List<AttributeInfo> getGlobalResults() {
 112  0
         return globalResults;
 113  
     }
 114  
 
 115  
     public void setGlobalResults(List<AttributeInfo> globalResults) {
 116  0
         this.globalResults = globalResults;
 117  0
     }
 118  
 
 119  
     @Override
 120  
     public List<AttributeInfo> getParameters() {
 121  0
         return parameters;
 122  
     }
 123  
 
 124  
     public void setParameters(List<AttributeInfo> parameters) {
 125  0
         this.parameters = parameters;
 126  0
     }
 127  
 
 128  
     @Override
 129  
     public Integer getItemsProcessed() {
 130  0
         return itemsProcessed;
 131  
     }
 132  
 
 133  
     public void setItemsProcessed(Integer itemsProcessed) {
 134  0
         this.itemsProcessed = itemsProcessed;
 135  0
     }
 136  
 
 137  
     @Override
 138  
     public Integer getItemsExpected() {
 139  0
         return itemsExpected;
 140  
     }
 141  
 
 142  
     public void setItemsExpected(Integer itemsExpected) {
 143  0
         this.itemsExpected = itemsExpected;
 144  0
     }
 145  
 
 146  
     @Override
 147  
     public RichTextInfo getMessage() {
 148  0
         return message;
 149  
     }
 150  
 
 151  
     public void setMessage(RichTextInfo message) {
 152  0
         this.message = message;
 153  0
     }
 154  
 
 155  
    
 156  
 }