Coverage Report - org.kuali.rice.krms.impl.repository.TermBo
 
Classes in this File Line Coverage Branch Coverage Complexity
TermBo
86%
13/15
40%
4/10
0
 
 1  
 package org.kuali.rice.krms.impl.repository
 2  
 
 3  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 4  
 
 5  
 import org.kuali.rice.krms.api.repository.term.TermDefinition;
 6  
 import org.kuali.rice.krms.api.repository.term.TermDefinitionContract;
 7  
 
 8  
 
 9  
 public class TermBo extends PersistableBusinessObjectBase implements TermDefinitionContract {
 10  
 
 11  
         def String id
 12  
         def String specificationId
 13  
     def String description
 14  
 
 15  
         def TermSpecificationBo specification
 16  
         def List<TermParameterBo> parameters
 17  
 
 18  
         /**
 19  
         * Converts a mutable bo to it's immutable counterpart
 20  
         * @param bo the mutable business object
 21  
         * @return the immutable object
 22  
         */
 23  
    static TermDefinition to(TermBo bo) {
 24  0
            if (bo == null) { return null }
 25  1
            return org.kuali.rice.krms.api.repository.term.TermDefinition.Builder.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 TermBo from(TermDefinition im) {
 34  0
            if (im == null) { return null }
 35  
 
 36  1
            TermBo bo = new TermBo()
 37  1
            bo.id = im.id
 38  1
            bo.specificationId = im.specification.id
 39  1
        bo.description = im.description
 40  1
            bo.specification = TermSpecificationBo.from(im.specification)
 41  1
            bo.parameters = new ArrayList<TermParameterBo>()
 42  1
            for (parm in im.parameters){
 43  1
                    bo.parameters.add ( TermParameterBo.from(parm) )
 44  
            }
 45  1
            bo.versionNumber = im.versionNumber
 46  1
            return bo
 47  
    }
 48  
 
 49  
    public TermSpecificationBo getSpecification(){
 50  1
            return specification
 51  
    }
 52  
 
 53  
    public List<TermParameterBo> getParameters(){
 54  2
            return parameters
 55  
    }
 56  
 
 57  
 }