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