Coverage Report - org.kuali.student.r2.common.versionmanagement.dto.VersionInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
VersionInfo
0%
0/29
0%
0/2
1.071
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the Educational Community
 3  
  * License, Version 2.0 (the "License"); you may not use this file except in
 4  
  * compliance with the License. You may obtain a copy of the License at
 5  
  * http://www.osedu.org/licenses/ECL-2.0 Unless required by applicable law or
 6  
  * agreed to in writing, software distributed under the License is distributed
 7  
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 8  
  * express or implied. See the License for the specific language governing
 9  
  * permissions and limitations under the License.
 10  
  */
 11  
 
 12  
 package org.kuali.student.r2.common.versionmanagement.dto;
 13  
 
 14  
 import java.io.Serializable;
 15  
 import java.util.Date;
 16  
 import java.util.List;
 17  
 
 18  
 import javax.xml.bind.annotation.XmlAccessType;
 19  
 import javax.xml.bind.annotation.XmlAccessorType;
 20  
 import javax.xml.bind.annotation.XmlAnyElement;
 21  
 import javax.xml.bind.annotation.XmlElement;
 22  
 import javax.xml.bind.annotation.XmlType;
 23  
 
 24  
 import org.kuali.student.r2.common.versionmanagement.infc.Version;
 25  
 import org.w3c.dom.Element;
 26  
 
 27  
 @XmlType(name = "VersionInfo", propOrder = {"versionIndId", "sequenceNumber", "currentVersionStart", "currentVersionEnd", "versionComment", "versionedFromId", "_futureElements"})
 28  
 @XmlAccessorType(XmlAccessType.FIELD)
 29  
 public class VersionInfo implements Version, Serializable {
 30  
 
 31  
     private static final long serialVersionUID = 1L;
 32  
 
 33  
     @XmlElement
 34  
     private String versionIndId;
 35  
 
 36  
     @XmlElement
 37  
     private Long sequenceNumber;
 38  
 
 39  
     @XmlElement
 40  
     private Date currentVersionStart;
 41  
 
 42  
     @XmlElement
 43  
     private Date currentVersionEnd;
 44  
 
 45  
     @XmlElement
 46  
     private String versionComment;
 47  
 
 48  
     @XmlElement
 49  
     private String versionedFromId;
 50  
 
 51  
     @XmlAnyElement
 52  
     private List<Element> _futureElements;
 53  
 
 54  0
     public VersionInfo() {
 55  
 
 56  0
     }
 57  
 
 58  0
     public VersionInfo(Version version) {
 59  0
         if (version != null) {
 60  0
             this.versionIndId = version.getVersionIndId();
 61  0
             this.sequenceNumber = version.getSequenceNumber();
 62  0
             this.currentVersionStart = version.getCurrentVersionStart();
 63  0
             this.currentVersionEnd = version.getCurrentVersionEnd();
 64  0
             this.versionComment = version.getVersionComment();
 65  0
             this.versionedFromId = version.getVersionedFromId();
 66  
         }
 67  0
     }
 68  
 
 69  
     /**
 70  
      * Version independent Id that remains the same across all versions
 71  
      */
 72  
     @Override
 73  
     public String getVersionIndId() {
 74  0
         return versionIndId;
 75  
     }
 76  
 
 77  
     public void setVersionIndId(String versionIndId) {
 78  0
         this.versionIndId = versionIndId;
 79  0
     }
 80  
 
 81  
     /**
 82  
      * The sequence number of the version
 83  
      */
 84  
     @Override
 85  
     public Long getSequenceNumber() {
 86  0
         return sequenceNumber;
 87  
     }
 88  
 
 89  
     public void setSequenceNumber(Long sequenceNumber) {
 90  0
         this.sequenceNumber = sequenceNumber;
 91  0
     }
 92  
 
 93  
     /**
 94  
      * The date and time this version became current.
 95  
      */
 96  
     @Override
 97  
     public Date getCurrentVersionStart() {
 98  0
         return currentVersionStart;
 99  
     }
 100  
 
 101  
     public void setCurrentVersionStart(Date currentVersionStart) {
 102  0
         this.currentVersionStart = currentVersionStart;
 103  0
     }
 104  
 
 105  
     /**
 106  
      * The date and time when this version stopped being current.
 107  
      */
 108  
     @Override
 109  
     public Date getCurrentVersionEnd() {
 110  0
         return currentVersionEnd;
 111  
     }
 112  
 
 113  
     public void setCurrentVersionEnd(Date currentVersionEnd) {
 114  0
         this.currentVersionEnd = currentVersionEnd;
 115  0
     }
 116  
 
 117  
     /**
 118  
      * Comments associated with the verison
 119  
      */
 120  
     @Override
 121  
     public String getVersionComment() {
 122  0
         return versionComment;
 123  
     }
 124  
 
 125  
     public void setVersionComment(String versionComment) {
 126  0
         this.versionComment = versionComment;
 127  0
     }
 128  
 
 129  
     public void setVersionedFromId(String versionedFromId) {
 130  0
         this.versionedFromId = versionedFromId;
 131  0
     }
 132  
 
 133  
     @Override
 134  
     public String getVersionedFromId() {
 135  0
         return versionedFromId;
 136  
     }
 137  
 }