Coverage Report - org.kuali.rice.krms.impl.repository.TermSpecificationBo
 
Classes in this File Line Coverage Branch Coverage Complexity
TermSpecificationBo
78%
11/14
30%
3/10
0
 
 1  
 package org.kuali.rice.krms.impl.repository
 2  
 
 3  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 4  
 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition;
 5  
 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinitionContract;
 6  
 
 7  
 public class TermSpecificationBo extends PersistableBusinessObjectBase implements TermSpecificationDefinitionContract{
 8  
         
 9  
         private static final long serialVersionUID = 1L;
 10  
 
 11  
         def String id
 12  
         def String contextId
 13  
         def String name
 14  
         def String type
 15  
     def String description
 16  
 
 17  
     def List<CategoryBo> categories
 18  
 
 19  
         /**
 20  
         * Converts a mutable bo to it's immutable counterpart
 21  
         * @param bo the mutable business object
 22  
         * @return the immutable object
 23  
         */
 24  
    static TermSpecificationDefinition to(TermSpecificationBo bo) {
 25  0
            if (bo == null) { return null }
 26  1
            return org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition.Builder.create(bo).build()
 27  
    }
 28  
 
 29  
    /**
 30  
         * Converts a immutable object to it's mutable bo counterpart
 31  
         * @param im immutable object
 32  
         * @return the mutable bo
 33  
         */
 34  
    static TermSpecificationBo from(TermSpecificationDefinition im) {
 35  0
            if (im == null) { return null }
 36  
 
 37  2
            TermSpecificationBo bo = new TermSpecificationBo()
 38  2
            bo.id = im.id
 39  2
            bo.contextId = im.contextId
 40  2
            bo.name = im.name
 41  2
            bo.type = im.type
 42  2
        bo.description = im.description
 43  2
        bo.categories = new ArrayList<CategoryBo>()
 44  2
        for (category in im.categories) {
 45  0
            bo.categories.add(CategoryBo.from(category))
 46  
        }
 47  2
            bo.versionNumber = im.versionNumber
 48  
            
 49  2
            return bo
 50  
    }
 51  
  
 52  
 }