Coverage Report - org.kuali.rice.krms.impl.repository.FunctionParameterBo
 
Classes in this File Line Coverage Branch Coverage Complexity
FunctionParameterBo
39%
9/23
5%
1/20
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.function.FunctionParameterDefinition
 5  
 import org.kuali.rice.krms.api.repository.function.FunctionParameterDefinitionContract
 6  
 
 7  
 public class FunctionParameterBo extends PersistableBusinessObjectBase implements FunctionParameterDefinitionContract {
 8  
 
 9  
         def String id
 10  
         def String name
 11  
         def String description
 12  
         def String functionId
 13  
         def String parameterType
 14  
         def Integer sequenceNumber
 15  
         
 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 FunctionParameterDefinition to(FunctionParameterBo bo) {
 23  0
            if (bo == null) { return null }
 24  0
            return org.kuali.rice.krms.api.repository.function.FunctionParameterDefinition.Builder.create(bo).build()
 25  
    }
 26  
 
 27  
         /**
 28  
         * Converts a list of mutable bos to it's immutable counterpart
 29  
         * @param bos the list of mutable business objects
 30  
         * @return and immutable list containing the immutable objects
 31  
         */
 32  
    static List<FunctionParameterDefinition> to(List<FunctionParameterBo> bos) {
 33  0
            if (bos == null) { return null }
 34  0
            List<FunctionParameterDefinition> parms = new ArrayList<FunctionParameterDefinition>();
 35  0
            for (FunctionParameterBo p : bos){
 36  0
                    parms.add(FunctionParameterDefinition.Builder.create(p).build())
 37  
            }
 38  0
            return Collections.unmodifiableList(parms)
 39  
    }
 40  
    /**
 41  
         * Converts a immutable object to it's mutable bo counterpart
 42  
         * @param im immutable object
 43  
         * @return the mutable bo
 44  
         */
 45  
    static FunctionParameterBo from(FunctionParameterDefinition im) {
 46  0
            if (im == null) { return null }
 47  
 
 48  15
            FunctionParameterBo bo = new FunctionParameterBo()
 49  15
            bo.id = im.id
 50  15
            bo.name = im.name
 51  15
            bo.description = im.description
 52  15
            bo.functionId = im.functionId
 53  15
            bo.parameterType = im.parameterType
 54  15
            bo.sequenceNumber = im.sequenceNumber
 55  15
            bo.versionNumber = im.versionNumber
 56  15
            return bo
 57  
    }
 58  
    
 59  
    static List<FunctionParameterBo> from(List<FunctionParameterDefinition> ims){
 60  0
            if (ims == null) {return null }
 61  0
            List<FunctionParameterBo> bos = new ArrayList<FunctionParameterBo>();
 62  0
            for (FunctionParameterBo im : ims){
 63  0
                    FunctionParameterBo bo = from(im)
 64  0
                       bos.add(bo);
 65  
            }
 66  0
            return Collections.unmodifiableList(bos)
 67  
    }
 68  
  
 69  
 }