![JAR search and dependency download from the Maven repository](/logo.png)
main.java.com.nutanix.dp1.aio.deserializers.AioCaseInsensitiveEnumDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aiops-java-client Show documentation
Show all versions of aiops-java-client Show documentation
Manage infrastructure on-premises and in the cloud seamlessly through AIOps features such as Analysis, Reporting, Capacity Planning, What if Analysis, VM Rightsizing, Troubleshooting, App Discovery, Broad Observability, and Ops Automation through Playbooks.
The newest version!
package com.nutanix.dp1.aio.deserializers;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
@Slf4j
public abstract class AioCaseInsensitiveEnumDeserializer> extends StdDeserializer {
private final Class tClass;
protected AioCaseInsensitiveEnumDeserializer(Class tClass) {
super(tClass);
this.tClass = tClass;
}
@Override
public T deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
ObjectCodec codec = jsonParser.getCodec();
JsonNode node = codec.readTree(jsonParser);
String value = node.textValue();
return Enum.valueOf(tClass, value.toUpperCase());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy