Coverage Report - org.kuali.student.r2.common.dto.RelationshipInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
RelationshipInfo
0%
0/33
0%
0/6
1.188
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation 
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.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.osedu.org/licenses/ECL-2.0
 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.Date;
 21  
 
 22  
 import javax.xml.bind.annotation.XmlAccessType;
 23  
 import javax.xml.bind.annotation.XmlAccessorType;
 24  
 import javax.xml.bind.annotation.XmlAttribute;
 25  
 import javax.xml.bind.annotation.XmlElement;
 26  
 import javax.xml.bind.annotation.XmlTransient;
 27  
 
 28  
 import org.kuali.student.r2.common.infc.Relationship;
 29  
 
 30  
 /**
 31  
  * Information about a Relationship entity.
 32  
  *
 33  
  * @author tom
 34  
  */
 35  
 
 36  
 @XmlAccessorType(XmlAccessType.FIELD)
 37  
 @XmlTransient
 38  
 public abstract class RelationshipInfo 
 39  
     extends HasAttributesAndMetaInfo 
 40  
     implements Relationship, Serializable {
 41  
 
 42  
     private static final long serialVersionUID = 1L;
 43  
 
 44  
     @XmlAttribute
 45  
     private String id;
 46  
 
 47  
     @XmlAttribute
 48  
     private String typeKey;
 49  
 
 50  
     @XmlAttribute
 51  
     private String stateKey;
 52  
 
 53  
     @XmlElement
 54  
     private Date effectiveDate;
 55  
 
 56  
     @XmlElement
 57  
     private Date expirationDate;
 58  
 
 59  
     /**
 60  
      * Constructs a new RelationshipInfo.
 61  
      */
 62  0
     public RelationshipInfo() {
 63  0
     }
 64  
 
 65  
     /**
 66  
      * Constructs a new RelationshipInfo from another Relationship.
 67  
      *
 68  
      * @param relationship the Relationship top copy
 69  
      */
 70  
     public RelationshipInfo(Relationship relationship) {
 71  0
         super(relationship);
 72  
         
 73  0
         if (relationship != null) {
 74  0
             this.id = relationship.getId();
 75  0
             this.typeKey = relationship.getTypeKey();
 76  0
             this.stateKey = relationship.getStateKey();
 77  
 
 78  0
             if (relationship.getEffectiveDate() != null) {
 79  0
                 this.effectiveDate = new Date(relationship.getEffectiveDate().getTime());
 80  
             } 
 81  
 
 82  0
             if (relationship.getExpirationDate() != null) {
 83  0
                 this.expirationDate = new Date(relationship.getExpirationDate().getTime());
 84  
             }
 85  
         }
 86  0
     }
 87  
 
 88  
     @Override
 89  
     public String getId() {
 90  0
         return id;
 91  
     }
 92  
 
 93  
     public void setId(String id) {
 94  0
         this.id = id;
 95  0
     }
 96  
 
 97  
     @Override
 98  
     public String getTypeKey() {
 99  0
         return typeKey;
 100  
     }
 101  
         
 102  
     public void setTypeKey(String typeKey) {
 103  0
         this.typeKey = typeKey;
 104  0
     }
 105  
 
 106  
     @Override
 107  
     public String getStateKey() {
 108  0
         return stateKey;
 109  
     }
 110  
         
 111  
     public void setStateKey(String stateKey) {
 112  0
         this.stateKey = stateKey;
 113  0
     }
 114  
 
 115  
     @Override
 116  
     public Date getEffectiveDate() {
 117  0
         return effectiveDate;
 118  
     }
 119  
 
 120  
     public void setEffectiveDate(Date effectiveDate) {
 121  0
         this.effectiveDate = effectiveDate;
 122  0
     }
 123  
 
 124  
     @Override
 125  
     public Date getExpirationDate() {
 126  0
         return expirationDate;
 127  
     }
 128  
 
 129  
     public void setExpirationDate(Date expirationDate) {
 130  0
         this.expirationDate = expirationDate;
 131  0
     }
 132  
 
 133  
 
 134  
     // Compatibility 
 135  
 
 136  
     @Override
 137  
     @Deprecated
 138  
     public String getType() {
 139  0
         return getTypeKey();
 140  
     }
 141  
 
 142  
     @Deprecated
 143  
     public void setType(String typeKey) {
 144  0
         setTypeKey(typeKey);
 145  0
     }
 146  
 
 147  
     @Override
 148  
     @Deprecated
 149  
     public String getState() {
 150  0
         return getStateKey();
 151  
     }
 152  
 
 153  
     @Deprecated
 154  
     public void setState(String stateKey) {
 155  0
         setStateKey(stateKey);
 156  0
     }
 157  
 }