Coverage Report - org.kuali.rice.krms.impl.repository.FunctionBo
 
Classes in this File Line Coverage Branch Coverage Complexity
FunctionBo
0%
0/20
0%
0/12
0
 
 1  
 /**
 2  
  * Copyright 2005-2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.krms.impl.repository
 17  
 
 18  
 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 19  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 20  
 import org.kuali.rice.krms.api.repository.function.FunctionDefinition
 21  
 import org.kuali.rice.krms.api.repository.function.FunctionDefinitionContract
 22  
 
 23  
 public class FunctionBo extends PersistableBusinessObjectBase implements MutableInactivatable, FunctionDefinitionContract {
 24  
 
 25  
         def String id
 26  
         def String namespace
 27  
         def String name
 28  
         def String description
 29  
         def String returnType
 30  
         def String typeId
 31  
         def boolean active        
 32  
 
 33  
         def List<FunctionParameterBo> parameters
 34  
     def List<CategoryBo> categories
 35  
         
 36  
         /**
 37  
         * Converts a mutable bo to it's immutable counterpart
 38  
         * @param bo the mutable business object
 39  
         * @return the immutable object
 40  
         */
 41  
    static FunctionDefinition to(FunctionBo bo) {
 42  0
            if (bo == null) { return null }
 43  0
            return org.kuali.rice.krms.api.repository.function.FunctionDefinition.Builder.create(bo).build()
 44  
    }
 45  
 
 46  
    /**
 47  
         * Converts a immutable object to it's mutable bo counterpart
 48  
         * @param im immutable object
 49  
         * @return the mutable bo
 50  
         */
 51  
    static FunctionBo from(FunctionDefinition im) {
 52  0
            if (im == null) { return null }
 53  
 
 54  0
            FunctionBo bo = new FunctionBo()
 55  0
            bo.id = im.id
 56  0
            bo.namespace = im.namespace
 57  0
            bo.name = im.name
 58  0
            bo.description = im.description
 59  0
            bo.returnType = im.returnType
 60  0
            bo.typeId = im.typeId
 61  0
            bo.active = im.active
 62  0
            bo.versionNumber = im.versionNumber
 63  0
            bo.parameters = new ArrayList<FunctionParameterBo>()
 64  0
            for (parm in im.parameters){
 65  0
                    bo.parameters.add( FunctionParameterBo.from(parm) )
 66  
            }
 67  0
        bo.categories = new ArrayList<CategoryBo>()
 68  0
        for (category in im.categories) {
 69  0
            bo.categories.add(CategoryBo.from(category))
 70  
        }
 71  0
            bo.versionNumber = im.versionNumber
 72  0
            return bo
 73  
    }
 74  
  
 75  
    
 76  
 }