![JAR search and dependency download from the Maven repository](/logo.png)
com.windowsazure.messaging.LowerCaseEnumDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Notification-Hubs-java-sdk Show documentation
Show all versions of Notification-Hubs-java-sdk Show documentation
Azure Notification Hubs Java SDK for interacting with the data and management plane operations.
The newest version!
package com.windowsazure.messaging;
import com.google.gson.*;
import java.lang.reflect.Type;
public class LowerCaseEnumDeserializer implements JsonDeserializer {
@Override
public Enum deserialize(JsonElement json, Type type, JsonDeserializationContext context)
throws JsonParseException {
try {
if(type instanceof Class && ((Class>) type).isEnum()) {
Gson gson = new GsonBuilder().create();
return gson.fromJson(json.getAsString().toLowerCase(), type);
}
return null;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy