Search in sources :

Example 1 with RunMode

use of ml.shifu.shifu.container.obj.ModelBasicConf.RunMode in project shifu by ShifuML.

the class RunModeDeserializer method deserialize.

@Override
public RunMode deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    ObjectCodec oc = jp.getCodec();
    JsonNode node = oc.readTree(jp);
    for (RunMode value : RunMode.values()) {
        if (value.name().equalsIgnoreCase(node.textValue())) {
            return value;
        }
    }
    return null;
}
Also used : RunMode(ml.shifu.shifu.container.obj.ModelBasicConf.RunMode) JsonNode(com.fasterxml.jackson.databind.JsonNode) ObjectCodec(com.fasterxml.jackson.core.ObjectCodec)

Aggregations

ObjectCodec (com.fasterxml.jackson.core.ObjectCodec)1 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 RunMode (ml.shifu.shifu.container.obj.ModelBasicConf.RunMode)1