List of usage examples for org.apache.commons.collections4 CollectionUtils isEmpty
public static boolean isEmpty(final Collection<?> coll)
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
private Set<String> getProtocolAggregators(ProtocolReviewableBase minute) { if (CollectionUtils.isEmpty(aggregatorIds) && minute != null) { aggregatorIds = new HashSet<String>(); if (StringUtils.isNotBlank(minute.getProtocol().getProtocolNumber())) { Map<String, String> protocolAttr = new HashMap<String, String>(); protocolAttr.put(KcKimAttributes.PROTOCOL, minute.getProtocol().getProtocolNumber()); Set<String> protoResults = (Set<String>) roleService.getRoleMemberPrincipalIds(getNamespaceHook(), getAggregatorRoleNameHook(), new HashMap<String, String>(protocolAttr)); if (CollectionUtils.isNotEmpty(protoResults)) { aggregatorIds.addAll(protoResults); }// ww w. j a v a 2s.c o m } if (StringUtils.isNotBlank(minute.getProtocol().getLeadUnitNumber())) { Map<String, String> leadUnitAttr = new HashMap<String, String>(); leadUnitAttr.put(KcKimAttributes.UNIT_NUMBER, minute.getProtocol().getLeadUnitNumber()); Set<String> leadUnitResults = (Set<String>) roleService.getRoleMemberPrincipalIds( getNamespaceHook(), getAggregatorRoleNameHook(), new HashMap<String, String>(leadUnitAttr)); if (CollectionUtils.isNotEmpty(leadUnitResults)) { aggregatorIds.addAll(leadUnitResults); } } } return aggregatorIds; }
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
private Set<String> getProtocolViewers() { if (CollectionUtils.isEmpty(viewerIds)) { viewerIds = (Set<String>) roleService.getRoleMemberPrincipalIds(getNamespaceHook(), getProtocolViewerRoleNameHook(), null); }/*from w ww .j av a 2s. c o m*/ return viewerIds; }
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
private Set<String> getProtocolViewers(ProtocolReviewableBase minute) { if (CollectionUtils.isEmpty(viewerIds) && minute != null) { viewerIds = new HashSet<String>(); if (StringUtils.isNotBlank(minute.getProtocol().getProtocolNumber())) { Map<String, String> protocolAttr = new HashMap<String, String>(); /*//from w w w . ja va 2s . c om * IS the kim attr data for iacuc also under 'protocol'?? not sure, need to verify that */ protocolAttr.put(KcKimAttributes.PROTOCOL, minute.getProtocol().getProtocolNumber()); Set<String> protoResults = (Set<String>) roleService.getRoleMemberPrincipalIds(getNamespaceHook(), getProtocolViewerRoleNameHook(), new HashMap<String, String>(protocolAttr)); if (CollectionUtils.isNotEmpty(protoResults)) { viewerIds.addAll(protoResults); } } if (StringUtils.isNotBlank(minute.getProtocol().getLeadUnitNumber())) { Map<String, String> leadUnitAttr = new HashMap<String, String>(); leadUnitAttr.put(KcKimAttributes.UNIT_NUMBER, minute.getProtocol().getLeadUnitNumber()); Set<String> leadUnitResults = (Set<String>) roleService.getRoleMemberPrincipalIds( getNamespaceHook(), getProtocolViewerRoleNameHook(), new HashMap<String, String>(leadUnitAttr)); if (CollectionUtils.isNotEmpty(leadUnitResults)) { viewerIds.addAll(leadUnitResults); } } } return viewerIds; }
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
public Set<String> getAdminIds() { if (CollectionUtils.isEmpty(adminIds)) { populateAdmins(); } return adminIds; }
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
public List<String> getAdminUserNames() { if (CollectionUtils.isEmpty(adminUserNames)) { populateAdmins(); } return adminUserNames; }
From source file:org.kuali.kra.protocol.actions.reviewcomments.ReviewCommentsServiceImplBase.java
private int getNextAttachmentId(ProtocolBase protocol) { Map fieldValues = new HashMap(); fieldValues.put("protocolIdFk", protocol.getProtocolId()); List<PRA> reviewAttachments = (List<PRA>) businessObjectService .findMatchingOrderBy(getProtocolReviewAttachmentClassHook(), fieldValues, "attachmentId", false); if (CollectionUtils.isEmpty(reviewAttachments)) { return 1; } else {/*from www . j a v a 2s.c om*/ return reviewAttachments.get(0).getAttachmentId() + 1; } }
From source file:org.kuali.kra.protocol.ProtocolBase.java
public boolean isRenewalWithoutAmendment() { return isRenewal() && CollectionUtils.isEmpty(this.getProtocolAmendRenewal().getModules()); }
From source file:org.kuali.kra.protocol.ProtocolBase.java
public boolean isEmptyProtocolResearchAreas() { return CollectionUtils.isEmpty(getProtocolResearchAreas()); }
From source file:org.kuali.kra.protocol.ProtocolDocumentRuleBase.java
/** * At least one organization must be entered. * If the default value is removed, another organization must be added before user * can save/* ww w. j a v a 2 s. co m*/ * @see org.kuali.kra.irb.rule.SaveProtocolLocationRule#processSaveProtocolLocationBusinessRules(org.kuali.kra.irb.rule.event.SaveProtocolLocationEvent) */ public boolean processProtocolLocationBusinessRules(ProtocolDocumentBase document) { boolean isValid = true; if (CollectionUtils.isEmpty(document.getProtocol().getProtocolLocations())) { reportError(ERROR_PROPERTY_ORGANIZATION_ID, KeyConstants.ERROR_PROTOCOL_LOCATION_SHOULD_EXIST); isValid = false; } return isValid; }
From source file:org.openecomp.sdc.heat.services.manifest.ManifestUtil.java
/** * Scan file env map.// ww w . ja v a 2 s . co m * * @param fileData the file data * @param fileDataList the file data list * @param fileEnvMap the file env map */ public static void scanFileEnvMap(FileData fileData, List<FileData> fileDataList, Map<String, FileData> fileEnvMap) { if (CollectionUtils.isEmpty(fileDataList)) { return; } for (FileData childFileData : fileDataList) { FileData.Type childType = childFileData.getType(); if (fileData != null) { if (childType != null && childType.equals(FileData.Type.HEAT_ENV)) { fileEnvMap.put(fileData.getFile(), childFileData); } } scanFileEnvMap(childFileData, childFileData.getData(), fileEnvMap); } }