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
  • Field Details

  • 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

      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
      Parameters:
      context - the definition context
      Returns:
      true if the disable condition is external, false otherwise
    • init

      void init(Model model, ModelItem definition) throws Exception
      Used to do more initialization, checks, ... needing model items of distant objects Called by Model parsing when the model items of all models have been initialized.
      Parameters:
      model - the model containing the definition
      definition - 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 current DisableCondition against the given values
      Type Parameters:
      T - Type of object holding the data to evaluate
      Parameters:
      definition - the definition of the evaluated data
      dataPath - the path of the evaluated data. Needed to get the value to compare as condition ids are relative to this one
      oldDataPath - the old path of the evaluated data. Needed to get stored value if the data has been moved
      values - values to check conditions on
      object - the object holding the data to evaluate and the condition value
      contextualParameters - the contextual parameters
      Returns:
      true if the disable condition is true, false otherwise