View Javadoc

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