Interface DisableCondition
- All Known Implementing Classes:
AbstractExternalDisableCondition
,AbstractRelativeDisableCondition
,AbstractStaticRelativeDisableCondition
,BlockMCCSession2DisableCondition
,ConfigDisableCondition
,DataHolderRelativeDisableCondition
,DataHolderStaticRelativeDisableCondition
,SkinDisableCondition
,UsersAndGroupsDataDisableCondition
,VoidRelativeDisableCondition
,VoidStaticRelativeDisableCondition
public interface DisableCondition
Interface for a disable condition
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The available operators -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The pefix to use for external conditions' identifier -
Method Summary
Modifier and TypeMethodDescription<T> boolean
evaluate
(ModelItem definition, String dataPath, Optional<String> oldDataPath, Map<String, Object> values, Optional<T> object, Map<String, Object> contextualParameters) Evaluate the currentDisableCondition
against the given valuesgetId()
Get the idgetName()
Get the nameGet the operatorgetValue()
Get the valuevoid
Used to do more initialization, checks, ...default boolean
isExternal
(DefinitionContext context) Check if the current disable condition is external An external condition can not be computed only from the object's values
-
Field Details
-
EXTERNAL_CONDITION_ID_PREFIX
The pefix to use for external conditions' identifier- See Also:
-
-
Method Details
-
getId
Get the id- Returns:
- the condition identifier
-
getName
Get the name- Returns:
- the condition name
-
getOperator
Get the operator- Returns:
- The comparison operator
-
getValue
Get the value- Returns:
- The value to compare to
-
isExternal
Check if the current disable condition is external An external condition can not be computed only from the object's values- Parameters:
context
- the definition context- Returns:
true
if the disable condition is external,false
otherwise
-
init
Used to do more initialization, checks, ... needing model items of distant objects Called byModel
parsing when the model items of all models have been initialized.- Parameters:
model
- the model containing the definitiondefinition
- the model item defining this disable condition- Throws:
Exception
- if an error occurs or if an additional check fails.
-
evaluate
<T> boolean evaluate(ModelItem definition, String dataPath, Optional<String> oldDataPath, Map<String, Object> values, Optional<T> object, Map<String, Object> contextualParameters) Evaluate the currentDisableCondition
against the given values- Type Parameters:
T
- Type of object holding the data to evaluate- Parameters:
definition
- the definition of the evaluated datadataPath
- the path of the evaluated data. Needed to get the value to compare as condition ids are relative to this oneoldDataPath
- the old path of the evaluated data. Needed to get stored value if the data has been movedvalues
- values to check conditions onobject
- the object holding the data to evaluate and the condition valuecontextualParameters
- the contextual parameters- Returns:
true
if the disable condition istrue
,false
otherwise
-