Coverage Report - org.kuali.student.common.dto.RelationshipInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
RelationshipInfo
0%
0/10
0%
0/4
1.2
RelationshipInfo$Builder
0%
0/11
N/A
1.2
 
 1  
 /*
 2  
  * Copyright 2009 The Kuali Foundation Licensed under the Educational
 3  
  * Community License, Version 1.0 (the "License"); you may not use
 4  
  * this file except in compliance with the License. You may obtain a
 5  
  * copy of the License at http://www.opensource.org/licenses/ecl1.php
 6  
  * Unless required by applicable law or agreed to in writing, software
 7  
  * distributed under the License is distributed on an "AS IS" BASIS,
 8  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 9  
  * implied. See the License for the specific language governing
 10  
  * permissions and limitations under the License.
 11  
  */
 12  
 
 13  
 package org.kuali.student.common.dto;
 14  
 
 15  
 import java.io.Serializable;
 16  
 import java.util.Date;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlElement;
 21  
 import javax.xml.bind.annotation.XmlTransient;
 22  
 
 23  
 import org.kuali.student.common.infc.Relationship;
 24  
 
 25  
 /**
 26  
  * Information about a Relationship.
 27  
  */
 28  
 
 29  
 @XmlAccessorType(XmlAccessType.FIELD)
 30  
 @XmlTransient
 31  
 public abstract class RelationshipInfo extends IdEntityInfo implements Relationship, Serializable {
 32  
 
 33  
     @XmlElement
 34  
     private final Date effectiveDate;
 35  
 
 36  
     @XmlElement
 37  
     private final Date expirationDate;
 38  
 
 39  0
     protected RelationshipInfo() {
 40  0
         effectiveDate = null;
 41  0
         expirationDate = null;
 42  0
     }
 43  
 
 44  
     protected RelationshipInfo(Relationship builder) {
 45  0
         super(builder);
 46  0
         this.effectiveDate = null != builder.getEffectiveDate() ? new Date(builder.getEffectiveDate().getTime()) : null;
 47  0
         this.expirationDate = null != builder.getExpirationDate() ? new Date(builder.getExpirationDate().getTime()) : null;
 48  0
     }
 49  
 
 50  
     @Override
 51  
     public Date getEffectiveDate() {
 52  0
         return effectiveDate;
 53  
     }
 54  
 
 55  
     @Override
 56  
     public Date getExpirationDate() {
 57  0
         return expirationDate;
 58  
     }
 59  
 
 60  
     public static class Builder extends IdEntityInfo.Builder implements Relationship {
 61  
 
 62  
         private Date effectiveDate;
 63  
         private Date expirationDate;
 64  
 
 65  0
         public Builder() {}
 66  
 
 67  
         public Builder(Relationship amrInfo) {
 68  0
             super(amrInfo);
 69  0
             this.effectiveDate = amrInfo.getEffectiveDate();
 70  0
             this.expirationDate = amrInfo.getExpirationDate();
 71  0
         }
 72  
 
 73  
         public Date getEffectiveDate() {
 74  0
             return effectiveDate;
 75  
         }
 76  
 
 77  
         public void setEffectiveDate(Date effectiveDate) {
 78  0
             this.effectiveDate = effectiveDate;
 79  0
         }
 80  
 
 81  
         public Date getExpirationDate() {
 82  0
             return expirationDate;
 83  
         }
 84  
 
 85  
         public void setExpirationDate(Date expirationDate) {
 86  0
             this.expirationDate = expirationDate;
 87  0
         }
 88  
     }
 89  
 }