Coverage Report - org.kuali.student.common.dto.HasAttributesAndMetaInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
HasAttributesAndMetaInfo
0%
0/8
0%
0/2
1.286
HasAttributesAndMetaInfo$Builder
0%
0/14
0%
0/2
1.286
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may
 3  
  * not use this file except in compliance with the License. You may obtain a copy of the License at
 4  
  * http://www.osedu.org/licenses/ECL-2.0 Unless required by applicable law or agreed to in writing, software distributed
 5  
  * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 6  
  * implied. See the License for the specific language governing permissions and limitations under the License.
 7  
  */
 8  
 package org.kuali.student.common.dto;
 9  
 
 10  
 import java.io.Serializable;
 11  
 
 12  
 import javax.xml.bind.annotation.XmlElement;
 13  
 import javax.xml.bind.annotation.XmlTransient;
 14  
 
 15  
 import org.kuali.student.common.infc.HasAttributesAndMeta;
 16  
 import org.kuali.student.common.infc.Meta;
 17  
 
 18  0
 @SuppressWarnings("serial")
 19  
 @XmlTransient
 20  
 public abstract class HasAttributesAndMetaInfo extends HasAttributesInfo implements HasAttributesAndMeta, Serializable {
 21  
 
 22  
     @XmlElement
 23  
     private final MetaInfo metaInfo;
 24  
 
 25  0
     protected HasAttributesAndMetaInfo() {
 26  0
         metaInfo = null;
 27  0
     }
 28  
 
 29  
     protected HasAttributesAndMetaInfo(HasAttributesAndMeta builder) {
 30  0
         super(builder);
 31  0
         this.metaInfo = null != builder.getMetaInfo() ? new MetaInfo.Builder(builder.getMetaInfo()).build() : null;
 32  0
     }
 33  
 
 34  
     @Override
 35  
     public MetaInfo getMetaInfo() {
 36  0
         return metaInfo;
 37  
     }
 38  
 
 39  
     public static class Builder extends HasAttributesInfo.Builder implements HasAttributesAndMeta {
 40  
 
 41  
         private Meta metaInfo;
 42  
 
 43  0
         public Builder() {}
 44  
 
 45  
         public Builder(HasAttributesAndMeta hasAMInfo) {
 46  0
             super(hasAMInfo);
 47  
             
 48  0
             if (null != hasAMInfo.getMetaInfo()) {
 49  0
                     MetaInfo.Builder builder = new MetaInfo.Builder();
 50  0
                     builder.setCreateId(hasAMInfo.getMetaInfo().getCreateId());
 51  0
                     builder.setCreateTime(hasAMInfo.getMetaInfo().getCreateTime());
 52  0
                     builder.setUpdateId(hasAMInfo.getMetaInfo().getUpdateId());
 53  0
                     builder.setUpdateTime(hasAMInfo.getMetaInfo().getUpdateTime());
 54  0
                     builder.setVersionInd(hasAMInfo.getMetaInfo().getVersionInd());
 55  0
                     this.metaInfo = builder.build();
 56  
             }
 57  0
         }
 58  
 
 59  
         @Override
 60  
         public Meta getMetaInfo() {
 61  0
             return metaInfo;
 62  
         }
 63  
 
 64  
         public void setMetaInfo(Meta metaInfo) {
 65  0
             this.metaInfo = metaInfo;
 66  0
         }
 67  
     }
 68  
 }