Class MethodBasedConstraint
- java.lang.Object
 - 
- de.rwth.swc.coffee4j.engine.configuration.model.constraints.AbstractConstraint
 - 
- de.rwth.swc.coffee4j.engine.configuration.model.constraints.methodbased.MethodBasedConstraint
 
 
 
- 
- All Implemented Interfaces:
 Constraint
public class MethodBasedConstraint extends AbstractConstraint
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. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface de.rwth.swc.coffee4j.engine.configuration.model.constraints.Constraint
Constraint.ConstraintConstants 
 - 
 
- 
Constructor Summary
Constructors Constructor Description MethodBasedConstraint(String name, List<String> parameterNames, ConstraintFunction constraintFunction)Creates a constraint usingMethodBasedConstraint(String, List, ConstraintFunction, ConstraintStatus)withConstraintStatus.UNKNOWNMethodBasedConstraint(String name, List<String> parameterNames, ConstraintFunction constraintFunction, ConstraintStatus constraintStatus)Creates a new constraint. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckIfValid(Combination combination)Checks whether the given combination is valid or not.ConstraintFunctiongetConstraintFunction()ConstraintConverterFactorygetConverterFactory()- 
Methods inherited from class de.rwth.swc.coffee4j.engine.configuration.model.constraints.AbstractConstraint
getConstraintStatus, getName, getParameterNames, setName, toString 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
MethodBasedConstraint
public MethodBasedConstraint(String name, List<String> parameterNames, ConstraintFunction constraintFunction)
Creates a constraint usingMethodBasedConstraint(String, List, ConstraintFunction, ConstraintStatus)withConstraintStatus.UNKNOWN- Parameters:
 name- name to improve readability without further semanticsparameterNames- the names of all involved parameters. Must not be, or containnull, or be emptyconstraintFunction- the function by which the values for the parameters are constrained. Must not benull
 
- 
MethodBasedConstraint
public MethodBasedConstraint(String name, List<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 semanticsparameterNames- the names of all involved parameters. Must not be, or containnull, or be emptyconstraintFunction- the function by which the values for the parameters are constrained. Must not benullconstraintStatus- status is either Unknown or Correct which is related to conflict detection
 
 - 
 
- 
Method Detail
- 
checkIfValid
public boolean checkIfValid(Combination combination)
Description copied from interface:ConstraintChecks whether the given combination is valid or not.- Parameters:
 combination- combination to be checked.- Returns:
 trueiff the combination is valid.
 
- 
getConverterFactory
public ConstraintConverterFactory getConverterFactory()
- Returns:
 ConstraintConverterFactorythat can be used to convert this constraint.
 
- 
getConstraintFunction
public ConstraintFunction getConstraintFunction()
 
 - 
 
 -