use of org.drools.model.index.AlphaIndexImpl in project drools by kiegroup.
the class LambdaConstraintTestUtil method createCheeseTypeEqualsConstraint.
public static LambdaConstraint createCheeseTypeEqualsConstraint(final String rightValue, int indexId) {
// Typical LambdaConstraint used in drools-test-coverage. (type == "xxx")
Pattern pattern = new Pattern(0, new ClassObjectType(Cheese.class));
Predicate1<Cheese> predicate = new Predicate1.Impl<Cheese>(_this -> EvaluationUtil.areNullSafeEquals(_this.getType(), rightValue));
AlphaIndexImpl<Cheese, String> index = new AlphaIndexImpl<Cheese, String>(String.class, org.drools.model.Index.ConstraintType.EQUAL, indexId, _this -> _this.getType(), rightValue);
return createLambdaConstraint1(Cheese.class, pattern, predicate, index);
}
use of org.drools.model.index.AlphaIndexImpl in project drools by kiegroup.
the class LambdaConstraintTestUtil method createCheeseCharObjectTypeEqualsConstraint.
public static LambdaConstraint createCheeseCharObjectTypeEqualsConstraint(final char rightValue, int indexId) {
// Typical LambdaConstraint used in drools-test-coverage. indexId is required when the test uses hashKey
Pattern pattern = new Pattern(0, new ClassObjectType(Cheese.class));
Predicate1<Cheese> predicate = new Predicate1.Impl<Cheese>(_this -> EvaluationUtil.areNullSafeEquals(_this.getCharObjectType(), rightValue));
AlphaIndexImpl<Cheese, Character> index = new AlphaIndexImpl<Cheese, Character>(Character.class, org.drools.model.Index.ConstraintType.EQUAL, indexId, _this -> _this.getCharObjectType(), (char) rightValue);
return LambdaConstraintTestUtil.createLambdaConstraint1(Cheese.class, pattern, predicate, index);
}
use of org.drools.model.index.AlphaIndexImpl in project drools by kiegroup.
the class LambdaConstraintTestUtil method createCheesePriceEqualsConstraint.
public static LambdaConstraint createCheesePriceEqualsConstraint(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.areNullSafeEquals(_this.getPrice(), rightValue));
AlphaIndexImpl<Cheese, Integer> index = new AlphaIndexImpl<Cheese, Integer>(Integer.class, org.drools.model.Index.ConstraintType.EQUAL, indexId, _this -> _this.getPrice(), rightValue);
return createLambdaConstraint1(Cheese.class, pattern, predicate, index);
}
use of org.drools.model.index.AlphaIndexImpl in project drools by kiegroup.
the class LambdaConstraintTestUtil method createCheeseCharTypeEqualsConstraint.
public static LambdaConstraint createCheeseCharTypeEqualsConstraint(final char rightValue, int indexId) {
// Typical LambdaConstraint used in drools-test-coverage. indexId is required when the test uses hashKey
Pattern pattern = new Pattern(0, new ClassObjectType(Cheese.class));
Predicate1<Cheese> predicate = new Predicate1.Impl<Cheese>(_this -> EvaluationUtil.areNullSafeEquals(_this.getCharType(), rightValue));
AlphaIndexImpl<Cheese, Character> index = new AlphaIndexImpl<Cheese, Character>(Character.class, org.drools.model.Index.ConstraintType.EQUAL, indexId, _this -> _this.getCharType(), (char) rightValue);
return LambdaConstraintTestUtil.createLambdaConstraint1(Cheese.class, pattern, predicate, index);
}
use of org.drools.model.index.AlphaIndexImpl 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