- Type Parameters:
T- the condition value type
- All Known Subinterfaces:
AttributeConditionModel<T>,ColumnConditionModel<T>,ForeignKeyConditionModel
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().-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilds aConditionModelinstance.static interfaceProvides condition operands.static interfaceProvides a way to set the condition, each method a single change to it:changed()is notified once, when the method has set the operand, the operator and the enabled state, if the condition changed, its enabled state included, which is what the method returns.static enumThe possible wildcard types -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Boolean> Specifies whether conditions auto-enable by default.static 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.WildcardDefault value:ConditionModel.Wildcard.PREFIX_AND_POSTFIXstatic final StringThe wildcard character -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(@Nullable Comparable<T> value) Returns true if the given value is accepted by this models condition.builder()caption()Observer<?> changed()Notified once per change to the condition: aset()orclear(), or an operand, the operator,enabled(),caseSensitive()or the wildcard changed on its own, along with the enabling or disabling it causes when the conditionauto enables.voidclear()Clears this condition model, that is, disables it, clears all operands and sets the operator to the initial one.enabled()format()locked()operands()operator()set()type()
-
Field Details
-
WILDCARD_CHARACTER
The wildcard character- See Also:
-
WILDCARD
Specifies whether wildcards are added to string values- Value type:
ConditionModel.Wildcard - Default value:
ConditionModel.Wildcard.PREFIX_AND_POSTFIX
- See Also:
- Value type:
-
CASE_SENSITIVE
Specifies whether string based conditions are case-sensitive by default- Value type: Boolean
- Default value: false
- See Also:
-
AUTO_ENABLE
Specifies whether conditions auto-enable by default.- Value type: Boolean
- Default value: true
- See Also:
-
-
Method Details
-
caseSensitive
State caseSensitive()- Returns:
- the
Statecontrolling whether this model is case-sensitive, when working with strings
-
format
-
dateTimePattern
- Returns:
- the date/time format pattern to use when presenting a temporal value, an empty
Optionalin case none is available
-
autoEnable
State autoEnable()- Returns:
- the
Statecontrolling whether this model is enabled automatically when a condition value is specified
-
caption
- Returns:
- the caption associated with this condition model
-
locked
State locked()- Returns:
- the
Statecontrolling the locked status
-
type
- Returns:
- the value type 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, disables it, clears all operands and sets the operator to the initial one.- See Also:
-
operator
- Returns:
- a
Valuecontrolling the operator
-
operands
ConditionModel.Operands<T> operands()- Returns:
- the operands
-
set
ConditionModel.SetCondition<T> set()- Returns:
- the
ConditionModel.SetConditioninstance
-
accepts
Returns true if the given value is accepted by this models condition.
A missing operand, a null
ConditionModel.Operands.equal()or an emptyConditionModel.Operands.in(), means null:Operator.EQUALandOperator.INaccept null alone,Operator.NOT_EQUALandOperator.NOT_INany value but null.- Parameters:
value- the value- Returns:
- true if the given value is accepted by this models condition
-
changed
Observer<?> changed()Notified once per change to the condition: a
set()orclear(), or an operand, the operator,enabled(),caseSensitive()or the wildcard changed on its own, along with the enabling or disabling it causes when the conditionauto enables.Notified when the change has finished, so a listener sees the condition as set, never half set, and only when the condition differs from when it was last notified, an operand set to an equal value being no change.
- Returns:
- an observer notified each time the condition changes
-
builder
- Returns:
- a
ConditionModel.Builder.ValueTypeStepinstance
-