Coverage Report - org.kuali.rice.kim.framework.group.GroupEbo
 
Classes in this File Line Coverage Branch Coverage Complexity
GroupEbo
0%
0/16
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.kim.framework.group
 18  
 
 19  
 import org.kuali.rice.kim.api.common.attribute.KimAttributeData
 20  
 import org.kuali.rice.kim.api.group.Group
 21  
 import org.kuali.rice.kim.api.group.GroupContract
 22  
 import org.kuali.rice.kim.api.group.GroupMember
 23  
 import org.kuali.rice.krad.bo.ExternalizableBusinessObject
 24  
 import org.kuali.rice.core.api.mo.common.Attributes
 25  
 
 26  
 //@ToString
 27  
 class GroupEbo implements GroupContract, ExternalizableBusinessObject {
 28  
         private static final long serialVersionUID = 1L;
 29  
 
 30  
         String id
 31  
         String name
 32  
         String description
 33  
         boolean active
 34  
         String kimTypeId
 35  
         String namespaceCode
 36  
         List<GroupMember> members
 37  
         List<KimAttributeData> attributeDetails
 38  
     Attributes attributes
 39  
     Long versionNumber
 40  
         String objectId
 41  
 
 42  
     /**
 43  
      * Converts a mutable bo to its immutable counterpart
 44  
      * @param bo the mutable business object
 45  
      * @return the immutable object
 46  
      */
 47  
     static Group to(GroupEbo bo) {
 48  0
         if (bo == null) {
 49  0
             return null
 50  
         }
 51  
 
 52  0
         return Group.Builder.create(bo).build();
 53  
     }
 54  
 
 55  
     /**
 56  
      * Converts a immutable object to its mutable counterpart
 57  
      * @param im immutable object
 58  
      * @return the mutable bo
 59  
      */
 60  
     static GroupEbo from(Group im) {
 61  0
         if (im == null) {
 62  0
             return null
 63  
         }
 64  
 
 65  0
         GroupEbo bo = new GroupEbo()
 66  0
         bo.id = im.id
 67  0
         bo.namespaceCode = im.namespaceCode
 68  0
         bo.name = im.name
 69  0
         bo.description = im.description
 70  0
         bo.active = im.active
 71  0
         bo.kimTypeId = im.kimTypeId
 72  0
         bo.attributes = im.attributes
 73  
         //TODO
 74  
         //attributeDetails?
 75  0
         bo.versionNumber = im.versionNumber
 76  0
                 bo.objectId = im.objectId;
 77  
 
 78  0
         return bo
 79  
     }
 80  
 
 81  
 
 82  
     void refresh() { }
 83  
 }