View Javadoc
1   /**
2    * Copyright 2005-2014 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.document.rule;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import org.kuali.rice.kim.bo.ui.KimDocumentRoleMember;
22  import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMember;
23  
24  /**
25   * KULRICE-4153: This class is used to receive a set of Role Members and return a set of active Role Members. 
26   * 
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   *
29   */
30  public class ActiveRoleMemberHelper {
31  
32  	public List<KimDocumentRoleMember> getActiveRoleMembers (List<KimDocumentRoleMember> roleMembers){
33  		List<KimDocumentRoleMember> activeRoleMembers = new ArrayList<KimDocumentRoleMember>();
34  		for (KimDocumentRoleMember roleMember : roleMembers)
35  		{
36  			if (roleMember.isActive())
37  			{
38  				activeRoleMembers.add(roleMember);
39  			}
40  		}		
41  		return activeRoleMembers;		
42  	}
43  	    
44      public List<RoleDocumentDelegationMember> getActiveDelegationRoleMembers(List<RoleDocumentDelegationMember> roleMembers) {
45          List<RoleDocumentDelegationMember> activeRoleMembers = new ArrayList<RoleDocumentDelegationMember>();
46          for (RoleDocumentDelegationMember roleMember : roleMembers) {
47              if (roleMember.isActive()) {
48                  activeRoleMembers.add(roleMember);
49              }
50          }
51          return activeRoleMembers;
52      }
53  }