Class 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 empty Optional instance.
    Author:
    mmoquillon
    • 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 a AssertionError is thrown.
        Overrides:
        matchFirst in class FilterMatcher<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.
        Overrides:
        result in class FilterMatcher<T,​U,​V>
        Returns:
        an Optional value. Empty means that no predicates were true.