Coverage Report - org.kuali.rice.kim.impl.permission.PermissionTemplateBo
 
Classes in this File Line Coverage Branch Coverage Complexity
PermissionTemplateBo
93%
14/15
75%
3/4
0
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 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 implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kim.impl.permission
 17  
 
 18  
 import javax.persistence.Column
 19  
 import javax.persistence.Entity
 20  
 import javax.persistence.Id
 21  
 import javax.persistence.Table
 22  
 import org.kuali.rice.kim.api.common.template.Template
 23  
 import org.kuali.rice.kim.api.common.template.TemplateContract
 24  
 import org.kuali.rice.kim.impl.common.template.TemplateBo
 25  
 
 26  
 @Entity
 27  
 @Table(name="KRIM_PERM_TMPL_T")
 28  
 public class PermissionTemplateBo extends TemplateBo implements TemplateContract {
 29  
     private static final long serialVersionUID = 1L;
 30  
 
 31  
     @Id
 32  
         @Column(name="PERM_TMPL_ID")
 33  
         String id
 34  
 
 35  
     /**
 36  
      * Converts a mutable bo to its immutable counterpart
 37  
      * @param bo the mutable business object
 38  
      * @return the immutable object
 39  
      */
 40  
     static Template to(PermissionTemplateBo bo) {
 41  1
         if (bo == null) {
 42  0
             return null
 43  
         }
 44  
 
 45  1
         return Template.Builder.create(bo).build();
 46  
     }
 47  
 
 48  
     /**
 49  
      * Converts a immutable object to its mutable counterpart
 50  
      * @param im immutable object
 51  
      * @return the mutable bo
 52  
      */
 53  
     static PermissionTemplateBo from(Template im) {
 54  2
         if (im == null) {
 55  1
             return null
 56  
         }
 57  
 
 58  1
         PermissionTemplateBo bo = new PermissionTemplateBo()
 59  1
         bo.id = im.id
 60  1
         bo.namespaceCode = im.namespaceCode
 61  1
         bo.name = im.name
 62  1
         bo.description = im.description
 63  1
         bo.active = im.active
 64  1
         bo.kimTypeId = im.kimTypeId
 65  1
         bo.versionNumber = im.versionNumber
 66  1
                 bo.objectId = im.objectId;
 67  
 
 68  1
         return bo
 69  
     }
 70  
 
 71  
 }