@Test public void declareType() { DerivedField derivedField = getDerivedField("FieldName"); KiePMMLDroolsType retrieved = fieldASTFactory.declareType(derivedField); commonValidateKiePMMLDroolsType(retrieved, derivedField); }
public KiePMMLDroolsType declareType(DerivedField derivedField) { String generatedType = getSanitizedClassName(derivedField.getName().getValue().toUpperCase()); String fieldName = derivedField.getName().getValue(); String fieldType = derivedField.getDataType().value(); fieldTypeMap.put(fieldName, new KiePMMLOriginalTypeGeneratedType(fieldType, generatedType)); return new KiePMMLDroolsType(generatedType, DATA_TYPE.byName(fieldType).getMappedClass().getSimpleName()); }
KiePMMLDerivedFieldASTFactory { public KiePMMLDroolsType declareType(DerivedField derivedField) { String generatedType = getSanitizedClassName(derivedField.getName().getValue().toUpperCase()); String fieldName = derivedField.getName().getValue(); String fieldType = derivedField.getDataType().value(); fieldTypeMap.put(fieldName, new KiePMMLOriginalTypeGeneratedType(fieldType, generatedType)); return new KiePMMLDroolsType(generatedType, DATA_TYPE.byName(fieldType).getMappedClass().getSimpleName()); } }
KiePMMLDerivedFieldASTFactory { public KiePMMLDroolsType declareType(DerivedField derivedField) { String generatedType = getSanitizedClassName(derivedField.getName().getValue().toUpperCase()); String fieldName = derivedField.getName().getValue(); String fieldType = derivedField.getDataType().value(); fieldTypeMap.put(fieldName, new KiePMMLOriginalTypeGeneratedType(fieldType, generatedType)); return new KiePMMLDroolsType(generatedType, DATA_TYPE.byName(fieldType).getMappedClass().getSimpleName()); } private  KiePMMLDerivedFieldASTFactory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); }
KiePMMLDerivedFieldASTFactory { public KiePMMLDroolsType declareType(DerivedField derivedField) { String generatedType = getSanitizedClassName(derivedField.getName().getValue().toUpperCase()); String fieldName = derivedField.getName().getValue(); String fieldType = derivedField.getDataType().value(); fieldTypeMap.put(fieldName, new KiePMMLOriginalTypeGeneratedType(fieldType, generatedType)); return new KiePMMLDroolsType(generatedType, DATA_TYPE.byName(fieldType).getMappedClass().getSimpleName()); } private  KiePMMLDerivedFieldASTFactory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); static KiePMMLDerivedFieldASTFactory factory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); List<KiePMMLDroolsType> declareTypes(final List<DerivedField> derivedFields); KiePMMLDroolsType declareType(DerivedField derivedField); }
KiePMMLDerivedFieldASTFactory { public KiePMMLDroolsType declareType(DerivedField derivedField) { String generatedType = getSanitizedClassName(derivedField.getName().getValue().toUpperCase()); String fieldName = derivedField.getName().getValue(); String fieldType = derivedField.getDataType().value(); fieldTypeMap.put(fieldName, new KiePMMLOriginalTypeGeneratedType(fieldType, generatedType)); return new KiePMMLDroolsType(generatedType, DATA_TYPE.byName(fieldType).getMappedClass().getSimpleName()); } private  KiePMMLDerivedFieldASTFactory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); static KiePMMLDerivedFieldASTFactory factory(final Map<String, KiePMMLOriginalTypeGeneratedType> fieldTypeMap); List<KiePMMLDroolsType> declareTypes(final List<DerivedField> derivedFields); KiePMMLDroolsType declareType(DerivedField derivedField);  }