Search in sources :

Example 1 with BinningMethod

use of ml.shifu.shifu.container.obj.ModelStatsConf.BinningMethod in project shifu by ShifuML.

the class BinningMethodDeserializer method deserialize.

@Override
public BinningMethod deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    ObjectCodec oc = jp.getCodec();
    JsonNode node = oc.readTree(jp);
    for (BinningMethod value : BinningMethod.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) BinningMethod(ml.shifu.shifu.container.obj.ModelStatsConf.BinningMethod)

Aggregations

ObjectCodec (com.fasterxml.jackson.core.ObjectCodec)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 BinningMethod (ml.shifu.shifu.container.obj.ModelStatsConf.BinningMethod)1