Module is.codion.common.model
Package is.codion.common.model.condition
Interface TableConditionModel<C>
- Type Parameters:
C
- the condition identifier type
public interface TableConditionModel<C>
Manages a set of
ConditionModel
s for table columns.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionObserver
<?> changed()
void
clear()
Clears the search state of all non-persistant condition models, disables them and resets the operator toOperator.EQUAL
.enabled()
Map
<C, ConditionModel<?>> get()
<T> ConditionModel
<T> The condition model associated withidentifier
<T> Optional
<ConditionModel<T>> The condition model associated withidentifier
persist()
static <C> TableConditionModel
<C> tableConditionModel
(Supplier<Map<C, ConditionModel<?>>> conditionModelFactory) Instantiates a newTableConditionModel
-
Method Details
-
get
Map<C,ConditionModel<?>> get()- Returns:
- an unmodifiable view of the available condition models
-
get
The condition model associated withidentifier
- Type Parameters:
T
- the condition value type- Parameters:
identifier
- the identifier for which to retrieve theConditionModel
- Returns:
- the
ConditionModel
associated with the given identifier - Throws:
IllegalArgumentException
- in case no condition model exists for the given identifier
-
optional
The condition model associated withidentifier
- Type Parameters:
T
- the condition value type- Parameters:
identifier
- the identifier for which to retrieve theConditionModel
- Returns:
- the
ConditionModel
for theidentifier
or an empty Optional in case one is not available
-
clear
void clear()Clears the search state of all non-persistant condition models, disables them and resets the operator toOperator.EQUAL
.- See Also:
-
enabled
ObservableState enabled()- Returns:
- an
ObservableState
enabled when any of the underlying condition models are enabled
-
changed
Observer<?> changed()- Returns:
- an observer notified each time the condition changes
-
persist
- Returns:
- a
ValueSet
controlling the identifiers of conditions which should persist when this condition model is cleared - See Also:
-
tableConditionModel
static <C> TableConditionModel<C> tableConditionModel(Supplier<Map<C, ConditionModel<?>>> conditionModelFactory) Instantiates a newTableConditionModel
- Type Parameters:
C
- the condition identifier type- Parameters:
conditionModelFactory
- supplies the condition models mapped to their respective column identifiers- Returns:
- a new
TableConditionModel
-