Class Constraint


  • public class Constraint
    extends java.lang.Object
    Defines a constraint for combinatorial testing as a collection of parameters names and a function which can check whether any given value assignment for those parameters is valid or not according to some logic defined by the function.
    • Field Detail

      • ANONYMOUS_CONSTRAINT

        public static final java.lang.String ANONYMOUS_CONSTRAINT
        See Also:
        Constant Field Values
    • Constructor Detail

      • Constraint

        public Constraint​(java.lang.String name,
                          java.util.List<java.lang.String> parameterNames,
                          ConstraintFunction constraintFunction)
      • Constraint

        public Constraint​(java.lang.String name,
                          java.util.List<java.lang.String> parameterNames,
                          ConstraintFunction constraintFunction,
                          ConstraintStatus constraintStatus)
        Creates a new constraint. It is most efficient if only the parameters really involved and not additional ones are given.
        Parameters:
        name - a name to improve readability without further semantics
        parameterNames - the names of all involved parameters. Must not be, or contain null, or be empty
        constraintFunction - the function by which the values for the parameters are constrained. Must not be null
        constraintStatus - status is either Unknown or Correct which is related to conflict detection
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
      • getParameterNames

        public java.util.List<java.lang.String> getParameterNames()
        Returns:
        the names of all involved parameters
      • getConstraintFunction

        public ConstraintFunction getConstraintFunction()
        Returns:
        the function constraining the values of the involved parameters
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object