Coverage Report - org.kuali.student.common.dto.CriteriaInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
CriteriaInfo
0%
0/18
0%
0/4
1.182
CriteriaInfo$1
N/A
N/A
1.182
CriteriaInfo$Builder
0%
0/14
N/A
1.182
 
 1  
 /*
 2  
  * Copyright 2009 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * 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 implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.student.common.dto;
 17  
 
 18  
 import java.io.Serializable;
 19  
 import java.util.ArrayList;
 20  
 import java.util.Collections;
 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.XmlElementWrapper;
 28  
 import javax.xml.bind.annotation.XmlType;
 29  
 
 30  
 import org.kuali.student.common.infc.Comparison;
 31  
 import org.kuali.student.common.infc.Criteria;
 32  
 import org.kuali.student.common.infc.ModelBuilder;
 33  
 import org.w3c.dom.Element;
 34  
 
 35  
 /**
 36  
  * Query to return some information regarding LUI to person relationships.
 37  
  *
 38  
  * @Author KSContractMojo
 39  
  * @Author Kamal
 40  
  * @Since Tue Mar 01 15:54:06 PST 2011
 41  
  * @See <a href="https://wiki.kuali.org/display/KULSTU/luiPersonRelationCriteria+Structure">LuiPersonRelationCriteria</a>
 42  
  */
 43  
 @XmlAccessorType(XmlAccessType.FIELD)
 44  
 @XmlType(name = "CriteriaInfo", propOrder = {"comparisons", "maxResults", "_futureElements"})
 45  0
 public class CriteriaInfo implements Criteria, Serializable {
 46  
 
 47  
     private static final long serialVersionUID = 1L;
 48  
     
 49  
     @XmlElementWrapper(name="comparisons")
 50  
     @XmlElement(name="comparison")
 51  
     private final List<ComparisonInfo> comparisons;
 52  
     @XmlElement
 53  
     private final Integer maxResults;
 54  
     @XmlAnyElement
 55  
     private final List<Element> _futureElements;
 56  
     
 57  0
     private CriteriaInfo() {
 58  0
         comparisons = null;
 59  0
         maxResults = null;
 60  0
         _futureElements = null;
 61  0
     }
 62  
 
 63  
     @Override
 64  
     public List<ComparisonInfo> getComparisons() {
 65  0
         return this.comparisons;
 66  
     }
 67  
 
 68  
     @Override
 69  
     public Integer getMaxResults() {
 70  0
         return this.maxResults;
 71  
     }
 72  
 
 73  0
     private CriteriaInfo(Criteria builder) {
 74  0
         if (builder.getComparisons() == null) {
 75  0
             this.comparisons = null;
 76  
         } else {
 77  0
             List<ComparisonInfo> list = new ArrayList(builder.getComparisons().size());
 78  0
             for (Comparison infc : builder.getComparisons()) {
 79  0
                 list.add(new ComparisonInfo.Builder(infc).build());
 80  
             }
 81  0
             this.comparisons = Collections.unmodifiableList(list);
 82  
         }
 83  0
         this.maxResults = builder.getMaxResults();
 84  0
         this._futureElements = null;
 85  0
     }
 86  
 
 87  0
     public static class Builder implements ModelBuilder<CriteriaInfo>, Criteria {
 88  
 
 89  
         private List<? extends Comparison> comparisons;
 90  
         private Integer maxResults;
 91  
 
 92  0
         public Builder() {
 93  0
         }
 94  
 
 95  0
         public Builder(Criteria info) {
 96  0
             this.comparisons = info.getComparisons();
 97  0
             this.maxResults = info.getMaxResults();
 98  0
         }
 99  
 
 100  
         public CriteriaInfo build() {
 101  0
             return new CriteriaInfo(this);
 102  
         }
 103  
 
 104  
         @Override
 105  
         public List<? extends Comparison> getComparisons() {
 106  0
             return this.comparisons;
 107  
         }
 108  
 
 109  
         @Override
 110  
         public Integer getMaxResults() {
 111  0
             return this.maxResults;
 112  
         }
 113  
 
 114  
         public void setComparisons(List<? extends Comparison> comparisons) {
 115  0
             this.comparisons = comparisons;
 116  0
         }
 117  
 
 118  
         public void setMaxResults(Integer maxResults) {
 119  0
             this.maxResults = maxResults;
 120  0
         }
 121  
     }
 122  
 }