Coverage Report - org.kuali.student.r2.common.dto.CriteriaInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
CriteriaInfo
0%
0/18
0%
0/8
1.667
 
 1  
 /*
 2  
  * Copyright 2009 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  
 
 17  
 package org.kuali.student.r2.common.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.ArrayList;
 21  
 import java.util.Collections;
 22  
 import java.util.List;
 23  
 
 24  
 import javax.xml.bind.annotation.XmlAccessType;
 25  
 import javax.xml.bind.annotation.XmlAccessorType;
 26  
 import javax.xml.bind.annotation.XmlAnyElement;
 27  
 import javax.xml.bind.annotation.XmlElement;
 28  
 import javax.xml.bind.annotation.XmlElementWrapper;
 29  
 import javax.xml.bind.annotation.XmlType;
 30  
 
 31  
 import org.kuali.student.r2.common.infc.Comparison;
 32  
 import org.kuali.student.r2.common.infc.Criteria;
 33  
 import org.w3c.dom.Element;
 34  
 
 35  
 /**
 36  
  * Query to return some information regarding LUI to person
 37  
  * relationships.
 38  
  * 
 39  
  * @author Kamal
 40  
  * @since Tue Mar 01 15:54:06 PST 2011
 41  
  */
 42  
 
 43  
 @XmlAccessorType(XmlAccessType.FIELD)
 44  
 @XmlType(name = "CriteriaInfo", propOrder = { 
 45  
                 "comparisons", "maxResults",
 46  
                 "_futureElements" })
 47  
 
 48  
 public class CriteriaInfo 
 49  
     implements Criteria, Serializable {
 50  
 
 51  
     private static final long serialVersionUID = 1L;
 52  
 
 53  
     @XmlElementWrapper(name = "comparisons")
 54  
     @XmlElement(name = "comparison")
 55  
     private List<ComparisonInfo> comparisons;
 56  
         
 57  
     @XmlElement
 58  
     private Integer maxResults;
 59  
     
 60  
     @XmlAnyElement
 61  
     private List<Element> _futureElements;
 62  
 
 63  
 
 64  
     /**
 65  
      * Constructs a new CriteriaInfo.
 66  
      */
 67  0
     public CriteriaInfo() {
 68  0
     }
 69  
 
 70  
     /**
 71  
      * Constructs a new CriteriaInfo from another Criteria.
 72  
      *
 73  
      * @param criteria the criteria to copy
 74  
      */
 75  0
     public CriteriaInfo(Criteria criteria) {
 76  0
         if (criteria != null) {
 77  0
             if (criteria.getComparisons() != null) {
 78  0
                 this.comparisons = new ArrayList<ComparisonInfo>();
 79  0
                 for (Comparison comparison : criteria.getComparisons()) {
 80  0
                     this.comparisons.add(new ComparisonInfo(comparison));
 81  
                 }
 82  
             }
 83  0
             this.maxResults = criteria.getMaxResults();
 84  
         }
 85  0
     }
 86  
 
 87  
     @Override
 88  
     public List<? extends Comparison> getComparisons() {
 89  0
         if (comparisons == null) {
 90  0
             comparisons = new ArrayList<ComparisonInfo>(0);
 91  
         }
 92  
 
 93  0
         return this.comparisons;
 94  
     }
 95  
     
 96  
     public void setComparisons(List<ComparisonInfo> comparisons) {
 97  0
         this.comparisons = comparisons;
 98  0
     }
 99  
 
 100  
     @Override
 101  
     public Integer getMaxResults() {
 102  0
         return this.maxResults;
 103  
     }
 104  
     
 105  
     public void setMaxResults(Integer maxResults) {
 106  0
         this.maxResults = maxResults;
 107  0
     }
 108  
 }