Coverage Report - org.kuali.student.enrollment.lui.dto.LuiInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
LuiInfo
0%
0/25
0%
0/4
1.087
LuiInfo$1
N/A
N/A
1.087
LuiInfo$Builder
0%
0/29
N/A
1.087
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation 
 3  
  *
 4  
  * Licensed under the the Educational Community License, Version 1.0
 5  
  * (the "License"); you may not use this file except in compliance
 6  
  * with the 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.enrollment.lui.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.Date;
 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.common.dto.HasAttributesAndMetaInfo;
 30  
 import org.kuali.student.common.dto.IdEntityInfo;
 31  
 import org.kuali.student.common.infc.ModelBuilder;
 32  
 import org.kuali.student.enrollment.lui.infc.Lui;
 33  
 import org.w3c.dom.Element;
 34  
 
 35  
 
 36  
 /**
 37  
  * Detailed information about a single LUI.
 38  
  */
 39  
 
 40  
 @XmlAccessorType(XmlAccessType.FIELD)
 41  
 @XmlType(name = "LuiInfo", propOrder = {"id","typeKey","stateKey","luiCode", "cluId", "atpKey", "maxSeats", "effectiveDate", "expriationDate","metaInfo","attributes", "_futureElements"})
 42  0
 public class LuiInfo extends IdEntityInfo
 43  
   implements Serializable, Lui {
 44  
 
 45  
         private static final long serialVersionUID = 1L;
 46  
  
 47  
     @XmlElement
 48  
     private final String luiCode;
 49  
 
 50  
     @XmlElement
 51  
     private final String cluId;
 52  
 
 53  
     @XmlElement
 54  
     private final String atpKey;
 55  
 
 56  
     @XmlElement
 57  
     private final Integer maxSeats;
 58  
 
 59  
     @XmlElement
 60  
     private final Date effectiveDate;
 61  
 
 62  
     @XmlElement
 63  
     private final Date expirationDate;
 64  
 
 65  
     @XmlAnyElement
 66  
     private final List<Element> _futureElements;    
 67  
     
 68  0
     private LuiInfo() {
 69  0
             luiCode = null;
 70  0
             cluId = null;
 71  0
             atpKey = null;
 72  0
             maxSeats = null;
 73  0
             effectiveDate = null;
 74  0
             expirationDate = null;
 75  0
             _futureElements = null;
 76  0
     }
 77  
     
 78  
     private LuiInfo(Lui builder) {
 79  0
                 super(builder);
 80  0
                 this.luiCode = builder.getLuiCode();
 81  0
                 this.cluId = builder.getCluId();
 82  0
                 this.atpKey = builder.getAtpKey();
 83  0
                 this.maxSeats =builder.getMaxSeats();
 84  0
             this.effectiveDate = null != builder.getEffectiveDate()? new Date(builder.getEffectiveDate().getTime()) : null;
 85  0
             this.expirationDate = null != builder.getExpirationDate()? new Date(builder.getExpirationDate().getTime()) : null;
 86  0
                 this._futureElements = null;
 87  0
         }
 88  
 
 89  
     /**
 90  
      * Code identifier/name for the LUI. This is typically used in
 91  
      * human readable form (e.g. ENGL 100 section 123).
 92  
      */
 93  
     @Override
 94  
     public String getLuiCode() {
 95  0
         return luiCode;
 96  
     }
 97  
 
 98  
     /**
 99  
      * Unique identifier for a Canonical Learning Unit (CLU).
 100  
      */
 101  
     @Override
 102  
     public String getCluId() {
 103  0
         return cluId;
 104  
     }
 105  
 
 106  
     /**
 107  
      * Unique identifier for an Academic Time Period (ATP).
 108  
      */
 109  
     @Override
 110  
     public String getAtpKey() {
 111  0
         return atpKey;
 112  
     }
 113  
 
 114  
     /**
 115  
      * Maximum number of "seats" that the LUI will hold for registration.
 116  
      */
 117  
     @Override
 118  
     public Integer getMaxSeats() {
 119  0
         return maxSeats;
 120  
     }
 121  
 
 122  
     /**
 123  
      * Date and time that this LUI became effective. This is a similar
 124  
      * concept to the effective date on enumerated values. When an
 125  
      * expiration date has been specified, this field must be less
 126  
      * than or equal to the expiration date.
 127  
      */
 128  
     @Override
 129  
     public Date getEffectiveDate() {
 130  0
         return effectiveDate;
 131  
     }
 132  
 
 133  
     /**
 134  
      * Date and time that this LUI expires. This is a similar concept
 135  
      * to the expiration date on enumerated values. If specified, this
 136  
      * should be greater than or equal to the effective date. If this
 137  
      * field is not specified, then no expiration date has been
 138  
      * currently defined and should automatically be considered
 139  
      * greater than the effective date.
 140  
      */
 141  
     @Override
 142  
     public Date getExpirationDate() {
 143  0
         return expirationDate;
 144  
     }
 145  
 
 146  
    
 147  
 
 148  0
     public static class Builder extends IdEntityInfo.Builder implements ModelBuilder<LuiInfo>, Lui {
 149  
 
 150  
                 private String luiCode;
 151  
                 private String cluId;
 152  
                 private String atpKey;
 153  
                 private Integer maxSeats;
 154  
                 private Date effectiveDate;
 155  
                 private Date expirationDate;
 156  
                 
 157  0
                 public Builder() {}
 158  
                 
 159  
                 public Builder(Lui luiInfo) {
 160  0
                         super(luiInfo);
 161  0
                         this.luiCode = luiInfo.getLuiCode();
 162  0
                         this.cluId = luiInfo.getCluId();
 163  0
                         this.atpKey = luiInfo.getAtpKey();
 164  0
                         this.maxSeats = luiInfo.getMaxSeats();
 165  0
                         this.effectiveDate = luiInfo.getEffectiveDate();
 166  0
                         this.expirationDate = luiInfo.getExpirationDate();
 167  0
                 }
 168  
 
 169  
         @Override
 170  
                 public LuiInfo build() {
 171  0
                         return new LuiInfo(this);
 172  
                 }
 173  
 
 174  
         @Override
 175  
         public String getLuiCode() {
 176  0
             return luiCode;
 177  
         }
 178  
 
 179  
         public void setLuiCode(String luiCode) {
 180  0
             this.luiCode = luiCode;
 181  0
         }
 182  
 
 183  
         @Override
 184  
         public String getCluId() {
 185  0
             return cluId;
 186  
         }
 187  
 
 188  
         public void setCluId(String cluId) {
 189  0
             this.cluId = cluId;
 190  0
         }
 191  
 
 192  
         @Override
 193  
         public String getAtpKey() {
 194  0
             return atpKey;
 195  
         }
 196  
 
 197  
         public void setAtpKey(String atpKey) {
 198  0
             this.atpKey = atpKey;
 199  0
         }
 200  
 
 201  
         @Override
 202  
         public Integer getMaxSeats() {
 203  0
             return maxSeats;
 204  
         }
 205  
 
 206  
         public void setMaxSeats(Integer maxSeats) {
 207  0
             this.maxSeats = maxSeats;
 208  0
         }
 209  
 
 210  
         @Override
 211  
         public Date getEffectiveDate() {
 212  0
             return effectiveDate;
 213  
         }
 214  
 
 215  
         public void setEffectiveDate(Date effectiveDate) {
 216  0
             this.effectiveDate = effectiveDate;
 217  0
         }
 218  
 
 219  
         @Override
 220  
         public Date getExpirationDate() {
 221  0
             return expirationDate;
 222  
         }
 223  
 
 224  
         public void setExpirationDate(Date expirationDate) {
 225  0
             this.expirationDate = expirationDate;
 226  0
         }
 227  
     }
 228  
 }