Module is.codion.swing.common.model
Interface FilteredComboBoxModel.ItemFinder<T,V>
- Type Parameters:
T
- the combo box model item typeV
- the type of the value to search by
- Enclosing class:
- FilteredComboBoxModel<T>
public static interface FilteredComboBoxModel.ItemFinder<T,V>
Responsible for finding an item of type
FilteredComboBoxModel.ItemFinder
by a single value of type FilteredComboBoxModel.ItemFinder
.-
Method Summary
Modifier and TypeMethodDescriptioncreatePredicate
(V value) Returns thePredicate
to use when searching for the given valuedefault T
findItem
(Collection<T> items, V value) Returns the first item in the given collection containing the givenvalue
.Returns the value from the given item to use when searching
-
Method Details
-
value
Returns the value from the given item to use when searching- Parameters:
item
- the item, never null- Returns:
- the value associated with the given item
-
createPredicate
Returns thePredicate
to use when searching for the given value- Parameters:
value
- the value to search for, never null- Returns:
- a
Predicate
based on the given value
-
findItem
Returns the first item in the given collection containing the givenvalue
. Only called for non-nullvalue
s.- Parameters:
items
- the items to searchvalue
- the value to search for, never null- Returns:
- the first item in the given list containing the given value, null if none is found.
-