use of ml.shifu.shifu.container.obj.ModelTrainConf.MultipleClassification in project shifu by ShifuML.
the class MultipleClassificationDeserializer method deserialize.
/*
* (non-Javadoc)
*
* @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser,
* com.fasterxml.jackson.databind.DeserializationContext)
*/
@Override
public MultipleClassification deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
ObjectCodec oc = jp.getCodec();
JsonNode node = oc.readTree(jp);
for (MultipleClassification value : MultipleClassification.values()) {
if (value.name().equalsIgnoreCase(node.textValue())) {
return value;
}
}
return null;
}
Aggregations