public class Filters extends Object
Constructor and Description |
---|
Filters() |
Modifier and Type | Method and Description |
---|---|
static <T> Filter<T> |
compositeFilter(List<Filter<T>> filters) |
static Filter<String> |
containsAnyString(String... textValues)
Returns a filter which returns true if the String contains any of the given text values
|
static Filter<String> |
containsString(String text) |
static Filter<String> |
createStringFilter(String text)
Returns a String pattern matching filter using ! for not and * for any characters
|
static Filter<String> |
createStringFilters(Iterable<String> patterns)
Returns a filter if any of the String patterns match (using ! for not and * for any characters)
|
static <T> Filter<T> |
falseFilter() |
static <T> List<T> |
filter(Iterable<T> values,
Filter<T> filter)
Returns the string values which match the given filter
|
static <T> boolean |
isEmpty(Filter<T> filter) |
static <T> boolean |
matches(T value,
List<? extends Filter<T>> filters)
Returns true if any of the filters matches the given value
|
static <T> boolean |
matches(T value,
List<? extends Filter<T>> includeFilters,
List<? extends Filter<T>> excludeFilters)
Return true if the value matches an include filter if specified and does not match an exclude filter
|
static <T> T |
matchRandomElement(List<T> list)
Returns null if the list is empty or the first element for a size of 1 or returns a random element value
|
static <T> Filter<T> |
not(Filter<T> filter) |
static <T> Filter<T> |
or(Filter<T>... filters) |
static <T> Filter<T> |
or(List<Filter<T>> filters) |
static <T> Filter<T> |
trueFilter() |
public static <T> Filter<T> trueFilter()
public static <T> Filter<T> falseFilter()
public static <T> boolean matches(T value, List<? extends Filter<T>> filters)
public static <T> boolean matches(T value, List<? extends Filter<T>> includeFilters, List<? extends Filter<T>> excludeFilters)
public static Filter<String> containsAnyString(String... textValues)
public static <T> boolean isEmpty(Filter<T> filter)
public static Filter<String> createStringFilter(String text)
public static Filter<String> createStringFilters(Iterable<String> patterns)
public static <T> T matchRandomElement(List<T> list)
Copyright © 2011–2016 Red Hat. All rights reserved.