- Type Parameters:
T
- the condition value type
- All Known Implementing Classes:
ForeignKeyConditionModel
,SwingForeignKeyConditionModel
public interface ConditionModel<T>
Specifies a condition with an operator and operands as well as relevant events and states.
For instances create a
ConditionModel.Builder
via builder(Class)
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builds aConditionModel
instance.static interface
Provides access to the operands.static enum
The possible wildcard types -
Field Summary
Modifier and TypeFieldDescriptionstatic final PropertyValue<Boolean>
Specifies whether string based conditions are case-sensitive by default Value type: Boolean Default value: falsestatic final PropertyValue<ConditionModel.Wildcard>
Specifies whether wildcards are added to string values Value type:ConditionModel.Wildcard
Default value:ConditionModel.Wildcard.POSTFIX
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(Comparable<T> value) Returns true if the given value is accepted by this models condition.static <T> ConditionModel.Builder<T>
Returns a newConditionModel.Builder
instance.Observer<?>
changed()
void
clear()
Clears this condition model, that is, clears all operands and sets the operator to the initial one.enabled()
format()
locked()
operands()
operator()
wildcard()
Note that this is only applicable to string based condition models and only used for operatorsOperator.EQUAL
andOperator.NOT_EQUAL
-
Field Details
-
WILDCARD
Specifies whether wildcards are added to string values- Value type:
ConditionModel.Wildcard
- Default value:
ConditionModel.Wildcard.POSTFIX
- Value type:
-
CASE_SENSITIVE
Specifies whether string based conditions are case-sensitive by default- Value type: Boolean
- Default value: false
-
-
Method Details
-
caseSensitive
State caseSensitive()- Returns:
- the
State
controlling whether this model is case-sensitive, when working with strings
-
format
- Returns:
- the Format object to use when formatting input, an empty Optional in case none is available
-
dateTimePattern
String dateTimePattern()- Returns:
- the date/time format pattern, if any
-
wildcard
Mutable<ConditionModel.Wildcard> wildcard()Note that this is only applicable to string based condition models and only used for operatorsOperator.EQUAL
andOperator.NOT_EQUAL
- Returns:
- the
Mutable
controlling whether wildcards are added to strings
-
autoEnable
State autoEnable()- Returns:
- the
State
controlling whether this model is enabled automatically when a condition value is specified
-
locked
State locked()- Returns:
- the
State
controlling the locked status
-
valueClass
- Returns:
- the value class this condition model is based on
-
operators
- Returns:
- the operators available in this condition model
-
enabled
State enabled()- Returns:
- a state controlling the enabled status
-
clear
void clear()Clears this condition model, that is, clears all operands and sets the operator to the initial one. -
operator
- Returns:
- a
Value
controlling on the operator
-
operands
ConditionModel.Operands<T> operands()- Returns:
- the operands
-
accepts
Returns true if the given value is accepted by this models condition.- Parameters:
value
- the value- Returns:
- true if the given value is accepted by this models condition
-
changed
Observer<?> changed()- Returns:
- an observer notified each time the condition changes
-
builder
Returns a newConditionModel.Builder
instance.- Type Parameters:
T
- the condition value type- Parameters:
valueClass
- the value class- Returns:
- a new
ConditionModel.Builder
instance
-