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