Class Contains

All Implemented Interfaces:
Serializable

public class Contains extends ExecutionPolicy
An execution policy rule that encapsulates a test of type property_value_or_expression contains a. The test applies to string values only.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • Contains

      public Contains(String propertyNameOrExpression, boolean ignoreCase, String a)
      Define an contains test 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 numeric value.
      ignoreCase - determines if the comparison should ignore the string case.
      a - the value to compare with.
  • Method Details

    • accepts

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

      public String toString(int n)
      Description copied from class: ExecutionPolicy
      Get an xml string representation of this policy with the specified starting indentation level.
      Specified by:
      toString in class ExecutionPolicy
      Parameters:
      n - the size of the indent to startwith.
      Returns:
      an indented string depending on the value of toStringIndent.
    • getLeftOperandValue

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