Class NotEqual

All Implemented Interfaces:
Serializable

public class NotEqual extends Equal
An execution policy rule that encapsulates a test of type property_value_or_expression not_equal_to a. The test applies to numeric, string or boolean values or expressions.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • NotEqual

      public NotEqual(ValueType valueType, String propertyNameOrExpression, String a)
      Define an inequality comparison between the numeric value of a property and another numeric value.
      Note that if the value type is equal to ValueType.STRING, then the comparison will be case-insensitive. To specify case sensitivity, use the #Equal(String, boolean, String) constructor instead.
      Parameters:
      valueType - the type of value to which thie equality comparison applies.
      propertyNameOrExpression - either a literal string which represents a property name, or an expression resolving to a numeric value.
      a - the value to compare with.
    • NotEqual

      public NotEqual(String propertyNameOrExpression, double a)
      Define an inequality comparison between the numeric value of a property and another numeric value.
      Parameters:
      propertyNameOrExpression - either a literal string which represents a property name, or an expression resolving to a numeric value.
      a - the value to compare with.
    • NotEqual

      public NotEqual(String propertyNameOrExpression, boolean ignoreCase, String a)
      Define an inequality comparison between the string value of a property and another string value.
      Parameters:
      propertyNameOrExpression - either a literal string which represents a property name, or an expression resolving to a string value.
      ignoreCase - determines if the comparison should ignore the string case.
      a - the value to compare with.
    • NotEqual

      public NotEqual(String propertyNameOrExpression, boolean a)
      Define an inequality comparison between the boolean value of a property and another boolean value.
      Parameters:
      propertyNameOrExpression - either a literal string which represents a property name, or an expression resolving to a boolean value.
      a - the value to compare with.
  • Method Details

    • accepts

      public boolean accepts(PropertiesCollection<String> info)
      Description copied from class: Equal
      Determines whether this policy accepts the specified node.
      Overrides:
      accepts in class Equal
      Parameters:
      info - system information for the node on which the tasks will run if accepted.
      Returns:
      true if the node is accepted, false otherwise.
    • getLeftOperandValue

      protected Object getLeftOperandValue(PropertiesCollection<String> properties)
      Parameters:
      properties - the proeprties collection to evaluate against.
      Returns:
      the typed value of the left operand expression.