Search in sources :

Example 21 with SimpleSetPredicate

use of org.dmg.pmml.SimpleSetPredicate in project drools by kiegroup.

the class PMMLModelTestUtils method getRandomSimpleSetPredicate.

public static SimpleSetPredicate getRandomSimpleSetPredicate(DataField dataField) {
    SimpleSetPredicate toReturn = getRandomSimpleSetPredicate();
    toReturn.setField(dataField.getName());
    toReturn.setBooleanOperator(getRandomSimpleSetPredicateOperator());
    Array.Type arrayType = getArrayType(dataField.getDataType());
    List<String> values = getStringObjects(arrayType, 3);
    Array array = getArray(arrayType, values);
    toReturn.setArray(array);
    return toReturn;
}
Also used : Array(org.dmg.pmml.Array) SimpleSetPredicate(org.dmg.pmml.SimpleSetPredicate)

Aggregations

SimpleSetPredicate (org.dmg.pmml.SimpleSetPredicate)21 List (java.util.List)11 Test (org.junit.Test)11 SimplePredicate (org.dmg.pmml.SimplePredicate)10 Array (org.dmg.pmml.Array)9 KiePMMLSimpleSetPredicate (org.kie.pmml.commons.model.predicates.KiePMMLSimpleSetPredicate)8 CompoundPredicate (org.dmg.pmml.CompoundPredicate)7 Collectors (java.util.stream.Collectors)6 ArrayList (java.util.ArrayList)5 Arrays (java.util.Arrays)5 Collections (java.util.Collections)5 DataField (org.dmg.pmml.DataField)5 FieldName (org.dmg.pmml.FieldName)5 Predicate (org.dmg.pmml.Predicate)5 KiePMMLCompoundPredicate (org.kie.pmml.commons.model.predicates.KiePMMLCompoundPredicate)5 KiePMMLSimplePredicate (org.kie.pmml.commons.model.predicates.KiePMMLSimplePredicate)5 PMMLModelTestUtils.getSimplePredicate (org.kie.pmml.compiler.api.testutils.PMMLModelTestUtils.getSimplePredicate)5 KiePMMLSimpleSetPredicateFactoryTest.getSimpleSetPredicate (org.kie.pmml.compiler.commons.codegenfactories.KiePMMLSimpleSetPredicateFactoryTest.getSimpleSetPredicate)5 KiePMMLDroolsRule (org.kie.pmml.models.drools.ast.KiePMMLDroolsRule)5 BlockStmt (com.github.javaparser.ast.stmt.BlockStmt)4