use of org.drools.mvel.model.Cheese in project drools by kiegroup.
the class LambdaConstraintTestUtil method createCheesePriceGreaterConstraint.
public static LambdaConstraint createCheesePriceGreaterConstraint(final int rightValue, int indexId) {
// Typical LambdaConstraint used in drools-test-coverage. (price > xxx)
Pattern pattern = new Pattern(0, new ClassObjectType(Cheese.class));
Predicate1<Cheese> predicate = new Predicate1.Impl<Cheese>(_this -> EvaluationUtil.greaterThan(_this.getPrice(), rightValue));
AlphaIndexImpl<Cheese, Integer> index = new AlphaIndexImpl<Cheese, Integer>(Integer.class, org.drools.model.Index.ConstraintType.GREATER_THAN, indexId, _this -> _this.getPrice(), rightValue);
return createLambdaConstraint1(Cheese.class, pattern, predicate, index);
}
Aggregations