Coverage Report - org.kuali.rice.krms.impl.repository.KrmsTypeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
KrmsTypeBo
78%
11/14
44%
8/18
0
 
 1  
 package org.kuali.rice.krms.impl.repository
 2  
 
 3  
 import org.kuali.rice.krad.bo.MutableInactivatable
 4  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 5  
 import org.kuali.rice.krms.api.repository.type.KrmsTypeDefinitionContract
 6  
 
 7  
 public class KrmsTypeBo extends PersistableBusinessObjectBase implements MutableInactivatable, KrmsTypeDefinitionContract {
 8  
 
 9  
         def String id
 10  
         def String name
 11  
         def String namespace
 12  
         def String serviceName
 13  
         def boolean active
 14  
         def List<KrmsTypeAttributeBo> attributes
 15  
         /**
 16  
         * Converts a mutable bo to it's immutable counterpart
 17  
         * @param bo the mutable business object
 18  
         * @return the immutable object
 19  
         */
 20  
         static org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition to(KrmsTypeBo bo) {
 21  0
                 if (bo == null) { return null }
 22  12
                 return org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition.Builder.create(bo).build();
 23  
         }
 24  
 
 25  
         /**
 26  
          * Converts a immutable object to it's mutable bo counterpart
 27  
          * @param im immutable object
 28  
          * @return the mutable bo
 29  
          */
 30  
         static KrmsTypeBo from(org.kuali.rice.krms.api.repository.type.KrmsTypeDefinition im) {
 31  0
                 if (im == null) { return null }
 32  
 
 33  3
                 KrmsTypeBo bo = new KrmsTypeBo()
 34  3
                 bo.id = im.id
 35  3
                 bo.name = im.name
 36  3
                 bo.namespace = im.namespace
 37  3
                 bo.serviceName = im.serviceName
 38  0
                 bo.active = (im.active == null) ? true : im.active;
 39  3
                 bo.attributes = new ArrayList<KrmsTypeAttributeBo>()
 40  3
                 for( attr in im.attributes ){
 41  6
                         bo.attributes.add(KrmsTypeAttributeBo.from(attr))
 42  
                 }
 43  3
                 bo.versionNumber = im.versionNumber
 44  3
                 return bo
 45  
         }
 46  
 
 47  
 }