Interface DisableCondition
- All Known Implementing Classes:
AbstractExternalDisableCondition,AbstractRelativeDisableCondition,AbstractStaticRelativeDisableCondition,BlockMCCSession2DisableCondition,ConfigDisableCondition,DataHolderRelativeDisableCondition,DataHolderStaticRelativeDisableCondition,ExcludeFromMCCDisableCondition,NotShared2DisableCondition,SkinDisableCondition,UsersAndGroupsDataDisableCondition,VoidRelativeDisableCondition,VoidStaticRelativeDisableCondition
public interface DisableCondition
Interface for a disable condition
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe available operators -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe pefix to use for external conditions' identifier -
Method Summary
Modifier and TypeMethodDescription<T> booleanevaluate(ModelItem definition, String dataPath, Optional<String> oldDataPath, Map<String, Object> values, Optional<T> object, Map<String, Object> contextualParameters) Evaluate the currentDisableConditionagainst the given valuesgetId()Get the idgetName()Get the nameGet the operatorgetValue()Get the valuevoidUsed to do more initialization, checks, ...default booleanisExternal(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:
trueif the disable condition is external,falseotherwise
-
init
Used to do more initialization, checks, ... needing model items of distant objects Called byModelparsing 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 currentDisableConditionagainst 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:
trueif the disable condition istrue,falseotherwise
-