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