public Filter<String> getFilter() { if (filter == null) { filter = Filters.createStringFilter(Strings.defaultIfEmpty(pattern, "*")); } return filter; } }
public DependencyId(String groupId, String artifactId, String classifier, String extension) { this.groupId = groupId; this.artifactId = artifactId; this.classifier = classifier; this.extension = extension; this.hashCode = Objects.hashCode(groupId, artifactId, classifier, extension); }
public static <T> boolean isEmpty(Filter<T> filter) { boolean empty = false; if (filter instanceof CompositeFilter) { // lets treat empty filters as not matching anything CompositeFilter<T> compositeFilter = (CompositeFilter<T>) filter; empty = compositeFilter.isEmpty(); } return empty; }
@Override public boolean matches(T t) { for (Filter<T> filter : filters) { if (filter.matches(t)) { return true; } } return false; }
@Override public File getJarFile() throws IOException { return Files.urlToFile(url, "fabric-tmp-fab-", ".fab"); }
public boolean matches(CamelContextService contextService) { return Filters.matches(contextService, includeContextFilters, excludeContextFilters); }
public static <T> Filter<T> compositeFilter(List<Filter<T>> filters) { if (filters.size() == 0) { return falseFilter(); } else if (filters.size() == 1) { return filters.get(0); } else { return new CompositeFilter<T>(filters); } }
public static String includeExcludeListsToText(Object includes, Object excludes) { return Strings.joinNotNull(" ", excludes != null ? "exclude" + excludes : null, includes != null ? "include" + includes : null); } }
/** * Returns true if any of the filters matches the given value */ public static <T> boolean matches(T value, List<? extends Filter<T>> filters) { if (filters != null) { for (Filter<T> filter : filters) { if (filter.matches(value)) { return true; } } } return false; }
public DependencyId(String groupId, String artifactId, String classifier, String extension) { this.groupId = groupId; this.artifactId = artifactId; this.classifier = classifier; this.extension = extension; this.hashCode = Objects.hashCode(groupId, artifactId, classifier, extension); }
public boolean matches(T t) { for (Filter filter : filters) { if (filter != null && filter.matches(t)) { return true; } } return false; }
public VersionedDependencyId(String groupId, String artifactId, String version, String extension, String classifier) { super(groupId, artifactId, classifier, notEmpty(extension) ? extension : "jar"); this.version = version; }
@Override public int hashCode() { return Objects.hashCode(className, properties); }
@Override public int hashCode() { return Objects.hashCode(className, properties); }