EqConstraint

Representation of the Equals Constraint. This constraint can be used independently or added to a And, Or, Not constraint to combine with other constraints. Extends BinaryConstraint.

Constructor

EqConstraint(): Constructs a default equals constraint.

Field Summary

MATCH_MODE_EXACT, MATCH_MODE_GLOB, MATCH_MODE_REGEXP

See BinaryConstraint.

Methods

Inherited from BinaryConstraint class :

, setMatchMode

Inherited from Constraint class:

See Constraint: getFact, getFactValue, getReason, getValue, setFact, setFactValue, setReason, setValue. 

Examples

Example of a Constraint to find resources that are running on Linux:

      eq = EqConstraint()
      eq.setFact("resource.os.family")
      eq.setValue("linux")

Example of a Constraint to match resource IDs using a regular expression:

      eq = EqConstraint()
      eq.setFact("resource.id")
      eq.setValue("webserver*")
      eq.setMatchMode(EqConstraint.MATCH_MODE_REGEXP)

See Also