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