Coverage Report - org.kuali.rice.krms.impl.repository.TermSpecificationBo
 
Classes in this File Line Coverage Branch Coverage Complexity
TermSpecificationBo
0%
0/16
0%
0/10
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.term.TermSpecificationDefinition;
 20  
 import org.kuali.rice.krms.api.repository.term.TermSpecificationDefinitionContract;
 21  
 
 22  
 public class TermSpecificationBo extends PersistableBusinessObjectBase implements TermSpecificationDefinitionContract{
 23  
         
 24  
         private static final long serialVersionUID = 1L;
 25  
 
 26  
         def String id
 27  
         def String name
 28  
     def String namespace
 29  
         def String type
 30  
     def String description
 31  
 
 32  0
     def List<CategoryBo> categories = new ArrayList<CategoryBo>()
 33  0
     def List<ContextBo> contexts = new ArrayList<ContextBo>()
 34  
 
 35  
         /**
 36  
         * Converts a mutable bo to it's immutable counterpart
 37  
         * @param bo the mutable business object
 38  
         * @return the immutable object
 39  
         */
 40  
    static TermSpecificationDefinition to(TermSpecificationBo bo) {
 41  0
            if (bo == null) { return null }
 42  0
            return org.kuali.rice.krms.api.repository.term.TermSpecificationDefinition.Builder.create(bo).build()
 43  
    }
 44  
 
 45  
    /**
 46  
         * Converts a immutable object to it's mutable bo counterpart
 47  
         * @param im immutable object
 48  
         * @return the mutable bo
 49  
         */
 50  
    static TermSpecificationBo from(TermSpecificationDefinition im) {
 51  0
            if (im == null) { return null }
 52  
 
 53  0
            TermSpecificationBo bo = new TermSpecificationBo()
 54  0
            bo.id = im.id
 55  0
            bo.namespace = im.namespace
 56  0
            bo.name = im.name
 57  0
            bo.type = im.type
 58  0
        bo.description = im.description
 59  0
        bo.categories = new ArrayList<CategoryBo>()
 60  0
        for (category in im.categories) {
 61  0
            bo.categories.add(CategoryBo.from(category))
 62  
        }
 63  0
            bo.versionNumber = im.versionNumber
 64  
            
 65  0
            return bo
 66  
    }
 67  
  
 68  
 }