public abstract class TypedFilter<T> extends Object implements Filter.TypedFilter<T>
Filter.AndFilter<T>, Filter.CombinedFilter<T>, Filter.EqualFilter<T>, Filter.ImpliesFilter<T>, Filter.NotFilter<T>, Filter.OrFilter<T>, Filter.TypedFilter<T>, Filter.Util
Constructor and Description |
---|
TypedFilter(Class<T> type) |
Modifier and Type | Method and Description |
---|---|
static <T> TypedFilter<T> |
create(Class<T> type)
Creates and returns a class based type filter with no additional
conditions.
|
static <T> TypedFilter<T> |
create(Class<T> type,
Filter<? super T> filter)
Creates and returns a class based type filter based on given
filter instance. |
static <T> TypedFilter<T> |
createExcludeFilter(Class<T> type,
Class<? extends T>... excludes)
Creates and returns a class based type filter with an additional exclude filtering of the specified sub classes.
|
static <T> TypedFilter<T> |
createIncludeFilter(Class<T> type,
Class<? extends T>... includes)
Creates and returns a class based type filter with an additional include filtering of the specified sub classes.
|
T |
filter(Object element)
Filter the given element and return either an object of this
classes type T or null, if the element does not match the
filter as defined by
Filter.accept(Object) . |
Class<T> |
getType()
Get the filter type.
|
@Nullable public T filter(Object element)
Filter.accept(Object)
.filter
in interface Filter.TypedFilter<T>
element
- The element to be filtered.@NotNull public final Class<T> getType()
getType
in interface Filter.TypedFilter<T>
public static <T> TypedFilter<T> create(@NotNull Class<T> type)
type
- The type to check for.public static <T> TypedFilter<T> create(@NotNull Class<T> type, @NotNull Filter<? super T> filter)
filter
instance.T
- Type of the filter.type
- The type to check for.filter
- Used for filtering.public static <T> TypedFilter<T> createExcludeFilter(@NotNull Class<T> type, Class<? extends T>... excludes)
T
- Type of the filter.type
- The type to check for.excludes
- A list of excluded classes.public static <T> TypedFilter<T> createIncludeFilter(@NotNull Class<T> type, Class<? extends T>... includes)
T
- Type of the filter.type
- The type to check basically for.includes
- A list of included classes that should not be filtered.Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408