Converts all properties in {@link #getAllAttributes(Class)} to a set of the attribute names.

@param classToInspect the class to inspect
@param filter a predicate that returns true when a attribute should be kept in resulting
collection.
482450
public static Set<String> getAttributeNames(
            final Class<?> classToInspect, final Predicate<Field> filter) {
        Set<String> allFields = new HashSet<>();
        getAllAttributes(classToInspect, allFields, FIELD_TO_NAME, filter);
        return allFields;
    }
1181860
public IFilterTerm buildFilter(IAssetType assetType, V1Instance instance) {
        FilterBuilder builder = new FilterBuilder(assetType, instance);

        internalModifyFilter(builder);
        internalModifyState(builder);
        return builder.root.hasTerm() ? builder.root : null;
    }
1191247
public static
            org.openbel.framework.api.AnnotationFilterCriteria
            convert(AnnotationFilterCriteria wsFilterCriteria)
                    throws InvalidIdException {

        org.openbel.framework.api.AnnotationFilterCriteria filterCriteria =
                new org.openbel.framework.api.AnnotationFilterCriteria(
                        convert(wsFilterCriteria.getAnnotationType()));

        filterCriteria.setInclude(wsFilterCriteria.isIsInclude());

        for (String s : wsFilterCriteria.getValueSet()) {
            filterCriteria.add(s);
        }

        return filterCriteria;
    }
822391
public static List<ModelAnnotation> buildAnnotationList(final Element element, final AnnotationFilter filter) {
		final List<ModelAnnotation> annotationList=new ArrayList<>();
		
		forEachAnnotations(element, filter, new AnnotationFoundListener() {

			@Override
			public void onAcceptAnnotation(Element executableMethod, String annotationClassName, Map<String, String> attributes) {
				ModelAnnotation annotation = new ModelAnnotation(annotationClassName, attributes);
				
				annotationList.add(annotation);
			}
		});
		
		return annotationList;
	}
172939
@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
  public List<Filter> instanceTagNamesToFilters() {
    return tagsUtils.getAwsTagNames().map(Stream::of).orElseGet(Stream::empty)
        .map(tagNames -> new Tuple<>(tagNames, tagsUtils.getInstanceTags()))
        .flatMap(namesAndTags -> namesAndTags.getVal2()
            .stream()
            .filter(tag -> namesAndTags.getVal1().contains(tag.getKey())))
        .map(tag -> new Filter("tag:" + tag.getKey(), Collections.singletonList(tag.getValue())))
        .collect(Collectors.toList());
  }
176819
private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) {
        if (filter == null) {
            throw MESSAGES.nullArgument("filter");
        }
        // Specified
        if (attributes != null) { return attributes; }
        // From the filter
        if (filter instanceof VirtualFileFilterWithAttributes) { return ((VirtualFileFilterWithAttributes) filter).getAttributes(); }
        // It will use the default
        return null;
    }
1349308
public List<Class<?>> scanClasses(Predicate<String> filter)
    {
        List<Class<?>> discoveredClasses = new ArrayList<>(128);

        // For each Forge addon...
        for (Addon addon : furnace.getAddonRegistry().getAddons(AddonFilters.allStarted()))
        {
            List<String> discoveredFileNames = filterAddonResources(addon, filter);

            // Then try to load the classes.
            for (String discoveredFilename : discoveredFileNames)
            {
                String clsName = PathUtil.classFilePathToClassname(discoveredFilename);
                try
                {
                    Class<?> clazz = addon.getClassLoader().loadClass(clsName);
                    discoveredClasses.add(clazz);
                }
                catch (ClassNotFoundException ex)
                {
                    LOG.log(Level.WARNING, "Failed to load class for name '" + clsName + "':\n" + ex.getMessage(), ex);
                }
            }
        }
        return discoveredClasses;
    }
1343301
public static <T> ArrayList<T> filterViews(Class<T> classToFilterBy, Iterable<?> viewList) {
		ArrayList<T> filteredViews = new ArrayList<T>();
		for (Object view : viewList) {
			if (view != null && classToFilterBy.isAssignableFrom(view.getClass())) {
				filteredViews.add(classToFilterBy.cast(view));
			}
		}
		viewList = null;
		return filteredViews;
	}
919364
private static Map<String, String> attributeCriterionToFilters(AttributeCriterion criterion) {
		Map<String, String> filters = new LinkedHashMap<String, String>();
		String filter = criterion.getAttributeName() + " " + criterion.getOperator() + " ";
		if (criterion.getValue() != null
				&& ((criterion.getValue().contains("\"") || criterion.getValue().contains(" ") || !criterion.getValue()
						.matches("(\\.|\\-|[0-9])*")) || "LIKE".equalsIgnoreCase(criterion.getOperator()))
				&& ((!"DURING".equals(criterion.getOperator().toUpperCase())
						&& !"BEFORE".equals(criterion.getOperator().toUpperCase()) && !"AFTER".equals(criterion
						.getOperator().toUpperCase())))) {
			filter += "\'" + criterion.getValue().replaceAll("\\*", "%") + "\'";
		} else {
			filter += criterion.getValue();
		}
		filters.put(criterion.getServerLayerId(), filter);
		return filters;
	}
1096625
@SuppressWarnings("unchecked")
    private static Filter<ArchivePath> getFilterInstance(final String filterClassName, final Class<?>[] ctorTypes,
        final Object[] ctorArguments) {
        // Precondition checks
        assert filterClassName != null && filterClassName.length() > 0 : "Filter class name must be specified";
        assert ctorTypes != null : "Construction types must be specified";
        assert ctorArguments != null : "Construction arguments must be specified";
        assert ctorTypes.length == ctorArguments.length : "The number of ctor arguments and their types must match";

        // Find the filter impl class in the configured CLs
        final Class<Filter<ArchivePath>> filterClass;
        try {
            filterClass = (Class<Filter<ArchivePath>>) ClassLoaderSearchUtil.findClassFromClassLoaders(filterClassName,
                ShrinkWrap.getDefaultDomain().getConfiguration().getClassLoaders());
        } catch (final ClassNotFoundException cnfe) {
            throw new IllegalStateException("Could not find filter implementation class " + filterClassName
                + " in any of the configured CLs", cnfe);
        }

        // Make the new instance
        return SecurityActions.newInstance(filterClass, ctorTypes, ctorArguments, Filter.class);
    }
673106
@Override
    public Set<Field> getDeclaredFields(FieldFilter filter) {
        return FieldUtils.getDeclaredFields(target, filter);
    }
290176
@Override
    @JsonIgnore
    public Set<String> getAvailableQueryAttributes(final IPersonAttributeDaoFilter filter) {
        final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider();
        return Collections.singleton(usernameAttributeProvider.getUsernameAttribute());
    }
1141080
private FilterUtils getFilterUtils(final Element ditavalRef) {
        if (ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF).isEmpty()) {
            return null;
        }
        final URI href = toURI(ditavalRef.getAttribute(ATTRIBUTE_NAME_HREF));
        final URI tmp = currentFile.resolve(href);
        final FileInfo fi = job.getFileInfo(tmp);
        final URI ditaval = fi.src;
        FilterUtils f = filterCache.get(ditaval);
        if (f == null) {
            ditaValReader.filterReset();
            logger.info("Reading " + ditaval);
            ditaValReader.read(ditaval);
            Map<FilterUtils.FilterKey, FilterUtils.Action> filterMap = ditaValReader.getFilterMap();
            f = new FilterUtils(filterMap, ditaValReader.getForegroundConflictColor(), ditaValReader.getBackgroundConflictColor());
            f.setLogger(logger);
            filterCache.put(ditaval, f);
        }
        return f;
    }
1352873
@Override
    public Set<String> getAvailableQueryAttributes(final IPersonAttributeDaoFilter filter) {
        this.jaxbLoader.getUnmarshalledObject(this.attributeLoader);
        return this.attributesCache;
    }
653697
@JsonIgnore
    @Override
    public Set<String> getPossibleUserAttributeNames(final IPersonAttributeDaoFilter filter) {
        return targetPersonAttributeDao.getPossibleUserAttributeNames(filter);
    }
1030704
private Set<JmxTreeNode> getMatchingChildren(String nameFilter, ObjectNode objectNode) {
        AttributesNode attributesNode = null;
        OperationsNode operationsNode = null;
        NotificationsNode notificationsNode = null;
        Set<JmxTreeNode> objectChildren = new TreeSet<JmxTreeNode>();
        for(JmxTreeNode child : objectNode.getChildren()) {

           
                if(child instanceof AttributesNode) {
                    Set<AttributeNode> attributes = getMatchingAttributes((AttributesNode) child, nameFilter);
                    if(!attributes.isEmpty()) {
                         attributesNode = new AttributesNode(ObjectNode.LABEL_ATTRIBUTES, attributes);
                    }
                } else if (child instanceof OperationsNode) {
                    Set<OperationNode> operations = getMatchingOperations((OperationsNode) child, nameFilter);
                    if(!operations.isEmpty()) {
                        operationsNode = new OperationsNode(ObjectNode.LABEL_OPERATIONS, operations);
                    }
                } else if (child instanceof NotificationsNode) {
                    Set<NotificationNode> notifications = getMatchingNotifications((NotificationsNode) child, nameFilter);
                    if(!notifications.isEmpty()) {
                        notificationsNode = new NotificationsNode(ObjectNode.LABEL_NOTIFICATIONS, notifications);
                    }
                }
                
            
        }
        
        if(attributesNode != null) {
            objectChildren.add(attributesNode);
        }
        if(operationsNode != null) {
            objectChildren.add(operationsNode);
        }
        if(notificationsNode != null) {
            objectChildren.add(notificationsNode);
        }
        return objectChildren;
    }
729127
@Override
    public T filter(Filter<ArchivePath> filter) {
        return this.shallowCopy(filter).as(getActualClass());
    }