Search in sources :

Example 1 with PostCorrelationMetric

use of ml.shifu.shifu.container.obj.ModelVarSelectConf.PostCorrelationMetric in project shifu by ShifuML.

the class PostCorrelationMetricDeserializer method deserialize.

/*
     * (non-Javadoc)
     * 
     * @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core.JsonParser,
     * com.fasterxml.jackson.databind.DeserializationContext)
     */
@Override
public PostCorrelationMetric deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    ObjectCodec oc = jp.getCodec();
    JsonNode node = oc.readTree(jp);
    for (PostCorrelationMetric value : PostCorrelationMetric.values()) {
        if (value.name().equalsIgnoreCase(node.textValue())) {
            return value;
        }
    }
    return null;
}
Also used : JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectCodec(com.fasterxml.jackson.core.ObjectCodec) PostCorrelationMetric(ml.shifu.shifu.container.obj.ModelVarSelectConf.PostCorrelationMetric)

Aggregations

ObjectCodec (com.fasterxml.jackson.core.ObjectCodec)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 PostCorrelationMetric (ml.shifu.shifu.container.obj.ModelVarSelectConf.PostCorrelationMetric)1