Class PropertyEqualityCondition

All Implemented Interfaces:
PropertyCondition, Condition, ContextAware, LifeCycle

Condition that evaluates to true when a property equals a specified expected value.

The property named by key is resolved using the inherited property lookup mechanism (see PropertyConditionBase). If the resolved property value equals value (using String.equals(Object)), this condition evaluates to true.

Since:
1.5.20
  • Constructor Details

  • Method Details

    • start

      public void start()
      Start the component and validate required parameters. If either key or value is null, an error is reported and the component does not start.
      Specified by:
      start in interface LifeCycle
      Overrides:
      start in class PropertyConditionBase
    • getValue

      public String getValue()
      Return the configured expected value.
      Returns:
      the expected value, or null if not set
    • setValue

      public void setValue(String value)
      Set the expected value that the resolved property must equal for this condition to evaluate to true.
      Parameters:
      value - the expected value
    • getKey

      public String getKey()
      Return the property key that will be looked up when evaluating the condition.
      Returns:
      the property key, or null if not set
    • setKey

      public void setKey(String key)
      Set the property key to resolve during evaluation.
      Parameters:
      key - the property key
    • evaluate

      public boolean evaluate()
      Evaluate the condition: resolve the property named by key and compare it to value.
      Returns:
      true if the resolved property equals the expected value; false otherwise