Coverage Report - org.kuali.rice.core.framework.parameter.ParameterEbo
 
Classes in this File Line Coverage Branch Coverage Complexity
ParameterEbo
0%
0/20
0%
0/4
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.core.framework.parameter
 17  
 
 18  
 import org.kuali.rice.core.api.parameter.EvaluationOperator
 19  
 import org.kuali.rice.core.api.parameter.ParameterContract
 20  
 import org.kuali.rice.krad.bo.ExternalizableBusinessObject
 21  
 
 22  
 //@ToString
 23  
 class ParameterEbo implements ParameterContract, ExternalizableBusinessObject {
 24  
 
 25  
     private static final long serialVersionUID = 1L;
 26  
 
 27  
     def String namespaceCode
 28  
     def String componentCode
 29  
     def String name
 30  
     def String applicationId
 31  
     def String value
 32  
     def String description
 33  
     def String parameterTypeCode
 34  
     def String evaluationOperatorCode
 35  
     def ParameterTypeEbo parameterType
 36  
     def Long versionNumber
 37  
         def String objectId
 38  
 
 39  
     @Override
 40  
         EvaluationOperator getEvaluationOperator() {
 41  0
                 return EvaluationOperator.fromCode(evaluationOperatorCode);
 42  
         }
 43  
 
 44  
     @Override
 45  
     ParameterTypeEbo getParameterType() {
 46  0
         return parameterType
 47  
     }
 48  
 
 49  
         /**
 50  
      * Converts a mutable bo to its immutable counterpart
 51  
      * @param bo the mutable business object
 52  
      * @return the immutable object
 53  
      */
 54  
     static org.kuali.rice.core.api.parameter.Parameter to(ParameterEbo bo) {
 55  0
         if (bo == null) {
 56  0
             return null
 57  
         }
 58  
 
 59  0
         return org.kuali.rice.core.api.parameter.Parameter.Builder.create(bo).build();
 60  
     }
 61  
 
 62  
     /**
 63  
      * Converts a immutable object to its mutable counterpart
 64  
      * @param im immutable object
 65  
      * @return the mutable bo
 66  
      */
 67  
     static ParameterEbo from(org.kuali.rice.core.api.parameter.Parameter im) {
 68  0
         if (im == null) {
 69  0
             return null
 70  
         }
 71  
 
 72  0
         ParameterEbo bo = new ParameterEbo()
 73  0
         bo.namespaceCode = im.namespaceCode
 74  0
         bo.componentCode = im.componentCode
 75  0
         bo.name = im.name
 76  0
         bo.applicationId = im.applicationId
 77  0
         bo.value = im.value
 78  0
         bo.description = im.description
 79  0
         bo.parameterTypeCode = im.parameterType.code
 80  0
         bo.evaluationOperatorCode = im.evaluationOperator.code
 81  
 
 82  0
         bo.parameterType = ParameterTypeEbo.from(im.parameterType)
 83  0
         bo.versionNumber = im.versionNumber
 84  0
                 bo.objectId = im.objectId
 85  
 
 86  0
         return bo
 87  
     }
 88  
 
 89  
     void refresh() { }
 90  
 }