Coverage Report - org.kuali.rice.kew.impl.type.KewTypeAttributeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
KewTypeAttributeBo
0%
0/15
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.kew.impl.type
 17  
 
 18  
 import org.kuali.rice.kew.api.repository.type.KewTypeAttribute
 19  
 import org.kuali.rice.kew.api.repository.type.KewTypeAttributeContract
 20  
 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable
 21  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 22  
 
 23  
 
 24  
 public class KewTypeAttributeBo extends PersistableBusinessObjectBase implements MutableInactivatable, KewTypeAttributeContract {
 25  
         
 26  
         def String id
 27  
         def String typeId
 28  
         def String attributeDefinitionId
 29  
         def Integer sequenceNumber
 30  
         def boolean active = true
 31  
         def KewAttributeDefinitionBo attributeDefinition
 32  
 
 33  
     public void setAttributeDefinition(KewAttributeDefinitionBo attrDef) {
 34  0
         if (attrDef != null) {
 35  0
              attributeDefinitionId = attrDef.getId()
 36  
        } else {
 37  
        // TODO:  why is attributeDefinitionId getting set to null here?   Can this be removed?
 38  
        //attributeDefinitionId = null;
 39  
       }
 40  0
       this.attributeDefinition = attrDef;
 41  
    }
 42  
 
 43  
     /**
 44  
     * Converts a mutable bo to it's immutable counterpart
 45  
     * @param bo the mutable business object
 46  
     * @return the immutable object
 47  
     */
 48  
    static KewTypeAttribute to(KewTypeAttributeBo bo) {
 49  0
        if (bo == null) { return null }
 50  0
        return org.kuali.rice.kew.api.repository.type.KewTypeAttribute.Builder.create(bo).build()
 51  
    }
 52  
 
 53  
    /**
 54  
     * Converts a immutable object to it's mutable bo counterpart
 55  
     * @param im immutable object
 56  
     * @return the mutable bo
 57  
     */
 58  
    static KewTypeAttributeBo from(KewTypeAttribute im) {
 59  0
        if (im == null) { return null }
 60  
 
 61  0
        KewTypeAttributeBo bo = new KewTypeAttributeBo()
 62  0
        bo.id = im.id
 63  0
        bo.typeId = im.typeId
 64  0
        bo.attributeDefinitionId = im.attributeDefinitionId
 65  0
        bo.sequenceNumber = im.sequenceNumber
 66  0
        bo.active = im.active
 67  0
        bo.attributeDefinition = KewAttributeDefinitionBo.from(im.attributeDefinition)
 68  0
        return bo
 69  
    }
 70  
    
 71  
    @Override
 72  
    KewAttributeDefinitionBo getAttributeDefinition() {
 73  0
        return attributeDefinition
 74  
    }
 75  
 }