KiePMMLFieldOperatorValue { public String getConstraintsAsString() { return constraintsString; } KiePMMLFieldOperatorValue(final String name, final BOOLEAN_OPERATOR operator, final List<KiePMMLOperatorValue> kiePMMLOperatorValues, final List<KiePMMLFieldOperatorValue> nestedKiePMMLFieldOperatorValues); String getName(); BOOLEAN_OPERATOR getOperator(); String getConstraintsAsString(); List<KiePMMLFieldOperatorValue> getNestedKiePMMLFieldOperatorValues(); List<KiePMMLOperatorValue> getKiePMMLOperatorValues(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static final String NO_FIELD_CONSTRAINT_PATTERN; static final String FIELD_CONSTRAINT_PATTERN; }
@Test public void getConstraintsAsString() { KiePMMLFieldOperatorValue kiePMMLFieldOperatorValue = getKiePMMLFieldOperatorValueWithName(); String expected = "value < 35 surrogate value > 85"; String retrieved = kiePMMLFieldOperatorValue.getConstraintsAsString(); assertEquals(expected, retrieved); kiePMMLFieldOperatorValue = getKiePMMLFieldOperatorValueWithoutName(); expected = "value < 35 surrogate value > 85"; retrieved = kiePMMLFieldOperatorValue.buildConstraintsString(); assertEquals(expected, retrieved); }