/** * See if the collection of entity reference strings is contained in the collection of entities. * * @param entityRefs * The collection (String) of entity references. * @param entities * The collection (Entity) of entity objects. * @return true if there is containment, false if not. */ public static boolean isContainedEntityRefsToEntities(Collection<String> entityRefs, Collection<Entity> entities) { for (Iterator<String> iRefs = entityRefs.iterator(); iRefs.hasNext();) { String findThisEntityRef = iRefs.next(); if (!entityCollectionContainsRefString(entities, findThisEntityRef)) return false; } return true; }
if (!entityCollectionContainsRefString(entities, entityRef)) { return false;
/** * Fill in the two collections of Entity reference strings - those added in newEntities that were not in oldEntityRefs, and those removed, i.e. in oldEntityRefs not in newEntities. */ public static void computeAddedRemovedEntityRefsFromNewEntitiesOldRefs(Collection<String> addedEntities, Collection<String> removedEntities, Collection<Entity> newEntities, Collection<String> oldEntityRefs) { // added for (Iterator<Entity> i = newEntities.iterator(); i.hasNext();) { Entity entity = i.next(); if (!refCollectionContainsEntity(oldEntityRefs, entity)) { addedEntities.add(entity.getReference()); } } // removed for (Iterator<String> i = oldEntityRefs.iterator(); i.hasNext();) { String entityRef = i.next(); if (!entityCollectionContainsRefString(newEntities, entityRef)) { removedEntities.add(entityRef); } } } }
if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref)) if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref))
if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref)) if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref))
if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref)) if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref))
if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref)) if (!EntityCollections.entityCollectionContainsRefString(allowedGroups, ref))