org.fusesource.common.util
Class Filters

java.lang.Object
  extended by org.fusesource.common.util.Filters

public class Filters
extends java.lang.Object


Constructor Summary
Filters()
           
 
Method Summary
static
<T> Filter<T>
compositeFilter(java.util.List<Filter<T>> filters)
           
static Filter<java.lang.String> createStringFilter(java.lang.String text)
          Returns a String pattern matching filter using ! for not and * for any characters
static
<T> Filter<T>
falseFilter()
           
static
<T> boolean
isEmpty(Filter<T> filter)
           
static
<T> boolean
matches(T value, java.util.List<? extends Filter<T>> filters)
          Returns true if any of the filters matches the given value
static
<T> boolean
matches(T value, java.util.List<? extends Filter<T>> includeFilters, java.util.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> Filter<T>
not(Filter<T> filter)
           
static
<T> Filter<T>
or(Filter<T>... filters)
           
static
<T> Filter<T>
trueFilter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filters

public Filters()
Method Detail

trueFilter

public static <T> Filter<T> trueFilter()

falseFilter

public static <T> Filter<T> falseFilter()

matches

public static <T> boolean matches(T value,
                                  java.util.List<? extends Filter<T>> filters)
Returns true if any of the filters matches the given value


matches

public static <T> boolean matches(T value,
                                  java.util.List<? extends Filter<T>> includeFilters,
                                  java.util.List<? extends Filter<T>> excludeFilters)
Return true if the value matches an include filter if specified and does not match an exclude filter


compositeFilter

public static <T> Filter<T> compositeFilter(java.util.List<Filter<T>> filters)

or

public static <T> Filter<T> or(Filter<T>... filters)

not

public static <T> Filter<T> not(Filter<T> filter)

isEmpty

public static <T> boolean isEmpty(Filter<T> filter)

createStringFilter

public static Filter<java.lang.String> createStringFilter(java.lang.String text)
Returns a String pattern matching filter using ! for not and * for any characters



Copyright © 2015 Red Hat. All Rights Reserved.