> + private final String type;
> +
> + Type(String type) {
> + this.type = type;
> + }
> +
> + public String type() {
> + return type;
> + }
> +
> + /**
> + * Used from jclouds builtin deserializer.
> + */
> + public static Type fromValue(String type) {
> + if (type != null) {
> + for (Type value : Type.values()) {
I can maybe shed some light on this. GSON will call fromValue to obtain the
content type. The String type can (from what I remember) be null, in which case
we want the Enum object as constructed by GSON to be null.
On the other hand, please make sure to also have the UNRECOGNIZED value
implemented as well! With this approach all your bases are covered.
Thanks!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13108493