Interface SearchFilter
- All Superinterfaces:
BiPredicate<MenuItem,String>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a search filter for menu items. This interface extends the BiPredicate functional interface and is used to
encapsulate the condition for filtering menu items based on a search query.
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic SearchFiltercontains()Creates a search filter that checks if the text of a menu item contains the given search text, regardless of case sensitivity.Creates a function that generates a disabled menu item indicating no results were found for a given search query.Methods inherited from interface java.util.function.BiPredicate
and, negate, or, test
-
Method Details
-
contains
Creates a search filter that checks if the text of a menu item contains the given search text, regardless of case sensitivity.- Returns:
- a
SearchFilterthat evaluates to true if the menu item's text contains the specified search text (case-insensitive), and false otherwise.
-
noResults
Creates a function that generates a disabled menu item indicating no results were found for a given search query.- Returns:
- a
Functionthat accepts a string (search query) and returns a disabled menu item with a message indicating no results for the provided query.
-