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