org.omnaest.utils.structure.element.filter
Interface ElementFilter<E>

Type Parameters:
E -
All Known Implementing Classes:
ElementFilterNotBlank, ExcludingElementFilter, ExcludingElementFilterConstant, ExcludingElementFilterNotNull

public interface ElementFilter<E>

An ElementFilter provides a filter(Object) and a getFilterMode() method. Both allow to identify elements to be excluded or included.

The ExcludingElementFilter provides an abstract implementation which return the ElementFilter.FilterMode.EXCLUDING by default and only needs to implement the filter(Object) method

Author:
Omnaest
See Also:
ExcludingElementFilter

Nested Class Summary
static class ElementFilter.FilterMode
          Declares the behavior mode which can be ElementFilter.FilterMode.EXCLUDING or ElementFilter.FilterMode.INCLUDING
 
Method Summary
 boolean filter(E element)
          The filter(Object) method should return true if the given element matches the internal ElementFilter.FilterMode
 ElementFilter.FilterMode getFilterMode()
          Returns the ElementFilter.FilterMode in which the filter acts.
 

Method Detail

getFilterMode

ElementFilter.FilterMode getFilterMode()
Returns the ElementFilter.FilterMode in which the filter acts. This can be ElementFilter.FilterMode.EXCLUDING or ElementFilter.FilterMode.INCLUDING

Returns:
ElementFilter.FilterMode

filter

boolean filter(E element)
The filter(Object) method should return true if the given element matches the internal ElementFilter.FilterMode

Parameters:
element -
Returns:


Copyright © 2013. All Rights Reserved.