@Override public void visit(final T element) { delegate.visit(function.get(element)); }
@Override public void visit(OfBizUser element) { visitor.visit(element.getExternalId()); } });
@Override public void find(@Nonnull final Visitor<EntityProperty> visitor) { for (EntityProperty property : find()) { visitor.visit(property); } }
private int runSingleQuery(final Visitor<GenericValue> visitor) { final AtomicInteger executionCount = new AtomicInteger(); select.visitWith(element -> { visitor.visit(element); executionCount.incrementAndGet(); }); return executionCount.intValue(); } };
@ClusterSafe ("the use of Cache.getKeys() is safe, as users and groups are fully populated, canonical caches") public void visitAllInDirectory(final long directoryId, Visitor<T> visitor) { final Cache<DirectoryEntityKey,T> cache = getCache(); for (DirectoryEntityKey key : cache.getKeys()) { if (key.getDirectoryId() == directoryId) { final T value = cache.get(key); if (value != null) { visitor.visit(value); } } } }