use of org.kie.pmml.commons.model.expressions.KiePMMLMapValues in project drools by kiegroup.
the class KiePMMLMapValuesInstanceFactory method getKiePMMLMapValues.
static KiePMMLMapValues getKiePMMLMapValues(final MapValues mapValues) {
DATA_TYPE dataType = mapValues.getDataType() != null ? DATA_TYPE.byName(mapValues.getDataType().value()) : null;
KiePMMLMapValues.Builder builder = KiePMMLMapValues.builder(UUID.randomUUID().toString(), getKiePMMLExtensions(mapValues.getExtensions()), mapValues.getOutputColumn()).withKiePMMLInlineTable(getKiePMMLInlineTable(mapValues.getInlineTable())).withDataType(dataType);
if (mapValues.getDefaultValue() != null) {
builder = builder.withDefaultValue(mapValues.getDefaultValue().toString());
}
if (mapValues.getMapMissingTo() != null) {
builder = builder.withMapMissingTo(mapValues.getMapMissingTo().toString());
}
if (mapValues.hasFieldColumnPairs()) {
builder = builder.withKiePMMLFieldColumnPairs(getKiePMMLFieldColumnPairs(mapValues.getFieldColumnPairs()));
}
return builder.build();
}
use of org.kie.pmml.commons.model.expressions.KiePMMLMapValues in project drools by kiegroup.
the class KiePMMLMapValuesInstanceFactoryTest method getKiePMMLMapValues.
@Test
public void getKiePMMLMapValues() {
MapValues toConvert = getRandomMapValues();
KiePMMLMapValues retrieved = KiePMMLMapValuesInstanceFactory.getKiePMMLMapValues(toConvert);
commonVerifyKiePMMLMapValues(retrieved, toConvert);
}
Aggregations