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.

@FunctionalInterface public interface SearchFilter extends BiPredicate<MenuItem,String>
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 Methods
    Modifier and Type
    Method
    Description
    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

      static SearchFilter 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 SearchFilter that evaluates to true if the menu item's text contains the specified search text (case-insensitive), and false otherwise.
    • noResults

      static Function<String,MenuItem> noResults()
      Creates a function that generates a disabled menu item indicating no results were found for a given search query.
      Returns:
      a Function that accepts a string (search query) and returns a disabled menu item with a message indicating no results for the provided query.