Coverage Report - org.kuali.rice.krms.impl.repository.KrmsTypeAttributeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
KrmsTypeAttributeBo
83%
10/12
25%
1/4
0
 
 1  
 package org.kuali.rice.krms.impl.repository
 2  
 
 3  
 import org.kuali.rice.krad.bo.Inactivatable
 4  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 5  
 import org.kuali.rice.krms.api.repository.type.KrmsTypeAttribute
 6  
 import org.kuali.rice.krms.api.repository.type.KrmsTypeAttributeContract
 7  
 
 8  
 public class KrmsTypeAttributeBo extends PersistableBusinessObjectBase implements Inactivatable, KrmsTypeAttributeContract {
 9  
 
 10  
         def String id
 11  
         def String typeId
 12  
         def String attributeDefinitionId
 13  
         def Integer sequenceNumber
 14  
         def boolean active
 15  
         def KrmsAttributeDefinitionBo attributeDefinition
 16  
 
 17  
         /**
 18  
          * Converts a mutable bo to it's immutable counterpart
 19  
          * @param bo the mutable business object
 20  
          * @return the immutable object
 21  
          */
 22  
         static KrmsTypeAttribute to(KrmsTypeAttributeBo bo) {
 23  0
                 if (bo == null) { return null }
 24  0
                 return org.kuali.rice.krms.api.repository.type.KrmsTypeAttribute.Builder
 25  
                         .create(bo).build()
 26  
         }
 27  
 
 28  
         /**
 29  
          * Converts a immutable object to it's mutable bo counterpart
 30  
          * @param im immutable object
 31  
          * @return the mutable bo
 32  
          */
 33  
         static KrmsTypeAttributeBo from(KrmsTypeAttribute im) {
 34  6
                 if (im == null) { return null }
 35  
 
 36  6
                 KrmsTypeAttributeBo bo = new KrmsTypeAttributeBo()
 37  6
                 bo.id = im.id
 38  6
                 bo.typeId = im.typeId
 39  6
                 bo.attributeDefinitionId = im.attributeDefinitionId
 40  6
                 bo.sequenceNumber = im.sequenceNumber
 41  6
                 bo.active = im.active
 42  6
                 bo.attributeDefinition = KrmsAttributeDefinitionBo.from(im.attributeDefinition)
 43  6
                 return bo
 44  
         }
 45  
         
 46  
         @Override
 47  
         KrmsAttributeDefinitionBo getAttributeDefinition() {
 48  2
                 return attributeDefinition
 49  
         }
 50  
         
 51  
 }