![JAR search and dependency download from the Maven repository](/logo.png)
com.ionos.go.plugin.notifier.util.CaseEnumAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of go-gchat-notifier Show documentation
Show all versions of go-gchat-notifier Show documentation
GoCD plugin to send notifications to GChat when pipeline states change
package com.ionos.go.plugin.notifier.util;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
public class CaseEnumAdapter implements JsonDeserializer {
@Override
public Enum deserialize(JsonElement json, java.lang.reflect.Type type, JsonDeserializationContext context)
throws JsonParseException {
try {
if (type instanceof Class && ((Class>) type).isEnum()) {
return Enum.valueOf((Class) type, json.getAsString().toLowerCase());
}
return null;
} catch (Exception e) {
throw new JsonParseException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy