Interface FilterComboBoxModel.ItemFinder<T,V>

Type Parameters:
T - the combo box model item type
V - the type of the value to search by
Enclosing interface:
FilterComboBoxModel<T>

public static interface FilterComboBoxModel.ItemFinder<T,V>
Responsible for finding an item of type FilterComboBoxModel.ItemFinder by a single value of type FilterComboBoxModel.ItemFinder.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Optional<T>
    findItem(Collection<T> items, V value)
    Returns the first item in the given collection containing the given value.
    predicate(V value)
    Returns the Predicate to use when searching for an item represented by the given value
    value(T item)
    Returns the value representing the given item
  • Method Details

    • value

      V value(T item)
      Returns the value representing the given item
      Parameters:
      item - the item, never null
      Returns:
      the value representing the given item
    • predicate

      Predicate<T> predicate(V value)
      Returns the Predicate to use when searching for an item represented by the given value
      Parameters:
      value - the value to search for, never null
      Returns:
      a Predicate for finding the item that is represented by the given value
    • findItem

      default Optional<T> findItem(Collection<T> items, V value)
      Returns the first item in the given collection containing the given value. Only called for non-null values.
      Parameters:
      items - the items to search
      value - the value to search for, never null
      Returns:
      the first item in the given list containing the given value, an empty Optional if none is found.