com.novell.zos.jdl
Class ContainsConstraint

java.lang.Object
  extended by com.novell.zos.jdl.Constraint
      extended by com.novell.zos.jdl.BinaryConstraint
          extended by com.novell.zos.jdl.ContainsConstraint

public class ContainsConstraint
extends BinaryConstraint

Representation of the Contains Constraint. Evaluates to true only if the left side fact is defined in the match context. If the left side is not defined, this will evaluate to False. Contains is typically used to check membership of a value in a group fact.

Example of building a ContainsConstraint to constrain that a resource belongs to a group:

          c = ContainsConstraint()
          c.setFact("resource.groups")
          c.setValue("webserver-group")
 
This constraint can be used independently or added to a AndConstraint>, OrConstraint, NotConstraint to combine with other constraints.


Field Summary
static int COMPARE_MODE_AND
          Mode for handling RHS arrays (OR or AND)
static int COMPARE_MODE_OR
           
 
Fields inherited from class com.novell.zos.jdl.BinaryConstraint
MATCH_MODE_EXACT, MATCH_MODE_GLOB, MATCH_MODE_REGEXP
 
Constructor Summary
ContainsConstraint()
           
 
Method Summary
 int getCompareMode()
           
 void setCompareMode(int mode)
          Set comparison mode of this constraint.
 void validate()
           
 
Methods inherited from class com.novell.zos.jdl.BinaryConstraint
getMatchMode, setMatchMode
 
Methods inherited from class com.novell.zos.jdl.Constraint
getFact, getFactValue, getReason, getValue, setFact, setFactValue, setReason, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPARE_MODE_AND

public static final int COMPARE_MODE_AND
Mode for handling RHS arrays (OR or AND)

See Also:
Constant Field Values

COMPARE_MODE_OR

public static final int COMPARE_MODE_OR
See Also:
Constant Field Values
Constructor Detail

ContainsConstraint

public ContainsConstraint()
Method Detail

validate

public void validate()
Overrides:
validate in class BinaryConstraint

setCompareMode

public void setCompareMode(int mode)
Set comparison mode of this constraint.
Use COMPARE_MODE_AND to mean all the left and right side values must compare. Use COMPARE_MODE_OR to mean any one of the left and right side values compare.

Parameters:
mode - compare mode

getCompareMode

public int getCompareMode()


Copyright (c) 2008 Novell, Inc. All rights reserved.