001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.document.rule; 017 018import java.util.ArrayList; 019import java.util.List; 020 021import org.kuali.rice.kim.bo.ui.KimDocumentRoleMember; 022import org.kuali.rice.kim.bo.ui.RoleDocumentDelegationMember; 023 024/** 025 * KULRICE-4153: This class is used to receive a set of Role Members and return a set of active Role Members. 026 * 027 * @author Kuali Rice Team (rice.collab@kuali.org) 028 * 029 */ 030public class ActiveRoleMemberHelper { 031 032 public List<KimDocumentRoleMember> getActiveRoleMembers (List<KimDocumentRoleMember> roleMembers){ 033 List<KimDocumentRoleMember> activeRoleMembers = new ArrayList<KimDocumentRoleMember>(); 034 for (KimDocumentRoleMember roleMember : roleMembers) 035 { 036 if (roleMember.isActive()) 037 { 038 activeRoleMembers.add(roleMember); 039 } 040 } 041 return activeRoleMembers; 042 } 043 044 public List<RoleDocumentDelegationMember> getActiveDelegationRoleMembers(List<RoleDocumentDelegationMember> roleMembers) { 045 List<RoleDocumentDelegationMember> activeRoleMembers = new ArrayList<RoleDocumentDelegationMember>(); 046 for (RoleDocumentDelegationMember roleMember : roleMembers) { 047 if (roleMember.isActive()) { 048 activeRoleMembers.add(roleMember); 049 } 050 } 051 return activeRoleMembers; 052 } 053}