@Test public void evaluationStringIn() { ARRAY_TYPE arrayType = ARRAY_TYPE.STRING; List<Object> values = getObjects(arrayType, 1); KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicate = getKiePMMLSimpleSetPredicate(values, arrayType, IN_NOTIN.IN); assertFalse(kiePMMLSimpleSetPredicate.evaluation("NOT")); assertTrue(kiePMMLSimpleSetPredicate.evaluation(values.get(0))); }
protected boolean evaluation(Object rawValue) { String stringValue = (String) ConverterTypeUtil.convert(String.class, rawValue); Object convertedValue = arrayType.getValue(stringValue); switch (inNotIn) { case IN: return values.contains(convertedValue); case NOT_IN: return !values.contains(convertedValue); default: throw new KiePMMLException("Unknown IN_NOTIN" + inNotIn); } }
KiePMMLSimpleSetPredicate extends KiePMMLPredicate { protected boolean evaluation(Object rawValue) { String stringValue = (String) ConverterTypeUtil.convert(String.class, rawValue); Object convertedValue = arrayType.getValue(stringValue); switch (inNotIn) { case IN: return values.contains(convertedValue); case NOT_IN: return !values.contains(convertedValue); default: throw new KiePMMLException("Unknown IN_NOTIN" + inNotIn); } } }
KiePMMLSimpleSetPredicate extends KiePMMLPredicate { protected boolean evaluation(Object rawValue) { String stringValue = (String) ConverterTypeUtil.convert(String.class, rawValue); Object convertedValue = arrayType.getValue(stringValue); switch (inNotIn) { case IN: return values.contains(convertedValue); case NOT_IN: return !values.contains(convertedValue); default: throw new KiePMMLException("Unknown IN_NOTIN" + inNotIn); } } protected  KiePMMLSimpleSetPredicate(final String name, final List<KiePMMLExtension> extensions, final ARRAY_TYPE arrayType, final IN_NOTIN inNotIn); }
KiePMMLSimpleSetPredicate extends KiePMMLPredicate { protected boolean evaluation(Object rawValue) { String stringValue = (String) ConverterTypeUtil.convert(String.class, rawValue); Object convertedValue = arrayType.getValue(stringValue); switch (inNotIn) { case IN: return values.contains(convertedValue); case NOT_IN: return !values.contains(convertedValue); default: throw new KiePMMLException("Unknown IN_NOTIN" + inNotIn); } } protected  KiePMMLSimpleSetPredicate(final String name, final List<KiePMMLExtension> extensions, final ARRAY_TYPE arrayType, final IN_NOTIN inNotIn); static Builder builder(final String name, final List<KiePMMLExtension> extensions, final ARRAY_TYPE arrayType, final IN_NOTIN inNotIn); @Override boolean evaluate(Map<String, Object> values); @Override String getName(); List<Object> getValues(); ARRAY_TYPE getArrayType(); IN_NOTIN getInNotIn(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
KiePMMLSimpleSetPredicate extends KiePMMLPredicate { protected boolean evaluation(Object rawValue) { String stringValue = (String) ConverterTypeUtil.convert(String.class, rawValue); Object convertedValue = arrayType.getValue(stringValue); switch (inNotIn) { case IN: return values.contains(convertedValue); case NOT_IN: return !values.contains(convertedValue); default: throw new KiePMMLException("Unknown IN_NOTIN" + inNotIn); } } protected  KiePMMLSimpleSetPredicate(final String name, final List<KiePMMLExtension> extensions, final ARRAY_TYPE arrayType, final IN_NOTIN inNotIn); static Builder builder(final String name, final List<KiePMMLExtension> extensions, final ARRAY_TYPE arrayType, final IN_NOTIN inNotIn); @Override boolean evaluate(Map<String, Object> values); @Override String getName(); List<Object> getValues(); ARRAY_TYPE getArrayType(); IN_NOTIN getInNotIn(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }