Coverage Report - org.kuali.student.enrollment.classI.hold.dto.HoldInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
HoldInfo
0%
0/24
0%
0/4
1.087
HoldInfo$Builder
0%
0/30
N/A
1.087
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 package org.kuali.student.enrollment.classI.hold.dto;
 16  
 
 17  
 import java.io.Serializable;
 18  
 import java.util.Date;
 19  
 import java.util.List;
 20  
 import org.w3c.dom.Element;
 21  
 
 22  
 import javax.xml.bind.annotation.XmlAccessType;
 23  
 import javax.xml.bind.annotation.XmlAccessorType;
 24  
 import javax.xml.bind.annotation.XmlAnyElement;
 25  
 import javax.xml.bind.annotation.XmlElement;
 26  
 
 27  
 import javax.xml.bind.annotation.XmlType;
 28  
 
 29  
 import org.kuali.student.r2.common.dto.IdEntityInfo;
 30  
 import org.kuali.student.r2.common.infc.ModelBuilder;
 31  
 import org.kuali.student.enrollment.classI.hold.infc.Hold;
 32  
 
 33  
 @XmlAccessorType(XmlAccessType.FIELD)
 34  
 @XmlType(name = "HoldInfo", propOrder = {"id", "typeKey", "stateKey", "name", "descr", "holdCategoryId", "personId", "isWarning", "isOverridable", "effectiveDate", "releasedDate", "metaInfo", "attributes", "_futureElements"})
 35  
 
 36  
 public class HoldInfo extends IdEntityInfo implements Hold, Serializable {
 37  
     private static final long serialVersionUID = 1L;
 38  
 
 39  
     @XmlElement
 40  
     private final String personId;
 41  
 
 42  
     @XmlElement
 43  
     private final String holdCategoryId;
 44  
 
 45  
     @XmlElement
 46  
     private final Boolean isWarning;
 47  
 
 48  
     @XmlElement
 49  
     private final Boolean isOverridable;
 50  
 
 51  
     @XmlElement
 52  
     private final Date effectiveDate;
 53  
 
 54  
     @XmlElement
 55  
     private final Date releasedDate;
 56  
 
 57  
     @XmlAnyElement
 58  
     private final List<Element> _futureElements;
 59  
 
 60  0
     private HoldInfo() {
 61  0
         personId = null;
 62  0
         isWarning = false;
 63  0
         isOverridable = false;
 64  0
         holdCategoryId = null;
 65  0
         effectiveDate = null;
 66  0
         releasedDate = null;
 67  0
         _futureElements = null;
 68  0
     }
 69  
 
 70  
     /**
 71  
      * Constructs a new HoldInfo from another Hold.
 72  
      *
 73  
      * @param hold the Hold to copy
 74  
      */
 75  
     public HoldInfo(Hold hold) {
 76  0
         super(hold);
 77  
 
 78  0
         this.personId = hold.getPersonId();
 79  0
         this.holdCategoryId = hold.getHoldCategoryId();
 80  0
         this.isWarning = hold.getIsWarning();
 81  0
         this.isOverridable = hold.getIsOverridable();
 82  
 
 83  0
         this.effectiveDate = null != hold.getEffectiveDate() ? new Date(hold.getEffectiveDate().getTime()) : null;
 84  0
         this.releasedDate = null != hold.getReleasedDate() ? new Date(hold.getReleasedDate().getTime()) : null;
 85  
 
 86  0
         _futureElements = null;
 87  0
     }
 88  
 
 89  
     @Override
 90  
     public String getPersonId() {
 91  0
         return personId;
 92  
     }
 93  
 
 94  
     @Override
 95  
     public String getHoldCategoryId() {
 96  0
         return holdCategoryId;
 97  
     }
 98  
 
 99  
     @Override
 100  
     public Boolean getIsWarning() {
 101  0
         return isWarning;
 102  
     }
 103  
 
 104  
     @Override
 105  
     public Boolean getIsOverridable() {
 106  0
         return isOverridable;
 107  
     }
 108  
 
 109  
     @Override
 110  
     public Date getEffectiveDate() {
 111  0
         return effectiveDate;
 112  
     }
 113  
 
 114  
     @Override
 115  
     public Date getReleasedDate() {
 116  0
         return releasedDate;
 117  
     }
 118  
 
 119  
     /**
 120  
      * The builder class for this HoldInfo.
 121  
      */
 122  0
     public static class Builder extends IdEntityInfo.Builder implements ModelBuilder<HoldInfo>, Hold {
 123  
 
 124  
         private String personId;
 125  
         private String holdCategoryId;
 126  
         private Boolean isWarning;
 127  
         private Boolean isOverridable;
 128  
         private Date effectiveDate;
 129  
         private Date releasedDate;
 130  
 
 131  
         /**
 132  
          * Constructs a new builder.
 133  
          */
 134  0
         public Builder() {
 135  0
         }
 136  
 
 137  
         /**
 138  
          * Constructs a new builder initialized from another 
 139  
          * Hold.
 140  
          */
 141  
         public Builder(Hold hold) {
 142  0
             super(hold);
 143  0
             this.personId = hold.getPersonId();
 144  0
             this.holdCategoryId = hold.getHoldCategoryId();
 145  0
             this.isWarning = hold.getIsWarning();
 146  0
             this.isOverridable = hold.getIsOverridable();
 147  0
             this.effectiveDate = hold.getEffectiveDate();
 148  0
             this.effectiveDate = hold.getReleasedDate();
 149  0
         }
 150  
 
 151  
         @Override
 152  
         public HoldInfo build() {
 153  0
             return new HoldInfo(this);
 154  
         }
 155  
 
 156  
         @Override
 157  
         public String getPersonId() {
 158  0
             return personId;
 159  
         }
 160  
 
 161  
         public void setPersonId(String personId) {
 162  0
             this.personId = personId;
 163  0
         }
 164  
 
 165  
         @Override
 166  
         public String getHoldCategoryId() {
 167  0
             return holdCategoryId;
 168  
         }
 169  
 
 170  
         public void setHoldCategoryId(String holdCategoryId) {
 171  0
             this.holdCategoryId = holdCategoryId;
 172  0
         }
 173  
 
 174  
         @Override
 175  
         public Boolean getIsWarning() {
 176  0
             return isWarning;
 177  
         }
 178  
 
 179  
         public void setIsWarning(Boolean isWarning) {
 180  0
             this.isWarning = isWarning;
 181  0
         }
 182  
 
 183  
         @Override
 184  
         public Boolean getIsOverridable() {
 185  0
             return isOverridable;
 186  
         }
 187  
 
 188  
         public void setIsOverridable(Boolean isOverridable) {
 189  0
             this.isOverridable = isOverridable;
 190  0
         }
 191  
 
 192  
         @Override
 193  
         public Date getEffectiveDate() {
 194  0
             return effectiveDate;
 195  
         }
 196  
 
 197  
         public void setEffectiveDate(Date effectiveDate) {
 198  0
             this.effectiveDate = effectiveDate;
 199  0
         }
 200  
 
 201  
         @Override
 202  
         public Date getReleasedDate() {
 203  0
             return releasedDate;
 204  
         }
 205  
 
 206  
         public void setReleasedDate(Date releasedDate) {
 207  0
             this.releasedDate = releasedDate;
 208  0
         }
 209  
     }
 210  
 }