com.novell.zos.jdl
Class ContainsConstraint
java.lang.Object
com.novell.zos.jdl.Constraint
com.novell.zos.jdl.BinaryConstraint
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.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
ContainsConstraint
public ContainsConstraint()
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.