Package org.drools.core.spi
Interface Constraint
-
- All Superinterfaces:
Cloneable
,Externalizable
,RuleComponent
,Serializable
- All Known Subinterfaces:
AlphaNodeFieldConstraint
,BetaNodeFieldConstraint
,IndexableConstraint
,IntervalProviderConstraint
- All Known Implementing Classes:
AbstractCompositeConstraint
,EvaluatorConstraint
,InstanceNotEqualsConstraint
,MutableTypeConstraint
,NegConstraint
,PredicateConstraint
,QueryNameConstraint
,TupleStartEqualsConstraint
,XpathConstraint
public interface Constraint extends RuleComponent, Externalizable, Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Constraint.ConstraintType
An enum for Constraint Types
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
addPackageNames(Collection<String> otherPkgs)
Constraint
clone()
Clones the constraintdefault boolean
equals(Object object, InternalKnowledgeBase kbase)
default BitMask
getListenedPropertyMask(Class modifiedClass, List<String> settableProperties)
default BitMask
getListenedPropertyMask(Optional<Pattern> pattern, Class modifiedClass, List<String> settableProperties)
Returns property reactivity BitMask of this constraint.default Collection<String>
getPackageNames()
Declaration[]
getRequiredDeclarations()
Returns all the declarations required by the given constraint implementation.Constraint.ConstraintType
getType()
Returns the type of the constraint, either ALPHA, BETA or UNKNOWNboolean
isTemporal()
Returns true in case this constraint is a temporal constraintdefault void
mergeEvaluationContext(Constraint other)
default void
registerEvaluationContext(BuildContext buildContext)
void
replaceDeclaration(Declaration oldDecl, Declaration newDecl)
When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch.-
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
-
-
-
-
Method Detail
-
getRequiredDeclarations
Declaration[] getRequiredDeclarations()
Returns all the declarations required by the given constraint implementation.- Returns:
-
replaceDeclaration
void replaceDeclaration(Declaration oldDecl, Declaration newDecl)
When a rule contains multiple logical branches, i.e., makes use of 'OR' CE, it is required to clone patterns and declarations for each logical branch. Since this is done at ReteOO build type, when constraints were already created, eventually some constraints need to update their references to the declarations.- Parameters:
oldDecl
-newDecl
-
-
clone
Constraint clone()
Clones the constraint- Returns:
-
getType
Constraint.ConstraintType getType()
Returns the type of the constraint, either ALPHA, BETA or UNKNOWN- Returns:
-
isTemporal
boolean isTemporal()
Returns true in case this constraint is a temporal constraint- Returns:
-
getListenedPropertyMask
default BitMask getListenedPropertyMask(Class modifiedClass, List<String> settableProperties)
-
getListenedPropertyMask
default BitMask getListenedPropertyMask(Optional<Pattern> pattern, Class modifiedClass, List<String> settableProperties)
Returns property reactivity BitMask of this constraint.- Parameters:
pattern
- which this constraint belongs to. if pattern is empty, bind variables are considered to be declared in the same pattern. It should be fine for alpha constraintsmodifiedClass
-settableProperties
-- Returns:
- property reactivity BitMask
-
equals
default boolean equals(Object object, InternalKnowledgeBase kbase)
-
registerEvaluationContext
default void registerEvaluationContext(BuildContext buildContext)
-
mergeEvaluationContext
default void mergeEvaluationContext(Constraint other)
-
getPackageNames
default Collection<String> getPackageNames()
-
addPackageNames
default void addPackageNames(Collection<String> otherPkgs)
-
-