Package org.silverpeas.core.util.filter
Class EmptyFilterMatcher<T,U,V>
- java.lang.Object
-
- org.silverpeas.core.util.filter.FilterMatcher<T,U,V>
-
- org.silverpeas.core.util.filter.EmptyFilterMatcher<T,U,V>
-
public class EmptyFilterMatcher<T,U,V> extends FilterMatcher<T,U,V>
An empty filter matcher. It does nothing and the return result is an emptyOptional
instance.- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterMatcher<T,U,V>
matchFirst(Predicate<T> predicate, Function<U,V> function)
Plays the specified predicate against the criterion and applies the specified function if and only if the predicate is true.Optional<V>
result()
Gets the result returned by the function associated with the first predicates that is true.
-
-
-
Method Detail
-
matchFirst
public FilterMatcher<T,U,V> matchFirst(Predicate<T> predicate, Function<U,V> function)
Description copied from class:FilterMatcher
Plays the specified predicate against the criterion and applies the specified function if and only if the predicate is true. If the criterion is true, the result is stored and the other next predicates aren't played. The result of the function cannot be null otherwise aAssertionError
is thrown.- Overrides:
matchFirst
in classFilterMatcher<T,U,V>
- Parameters:
predicate
- the predicate to match.function
- the function associated with the predicate and that returns a non-null computation result.- Returns:
- itself.
-
result
public Optional<V> result()
Description copied from class:FilterMatcher
Gets the result returned by the function associated with the first predicates that is true.
-
-