jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Shoylev <notificati...@github.com>
Subject Re: [jclouds] openstack console (#339)
Date Mon, 02 Jun 2014 22:57:43 GMT
> +      }
> +
> +      /**
> +       * Used from jclouds builtin deserializer.
> +       */
> +      public static Type fromValue(String type) {
> +          if (type != null) {
> +             for (Type value : Type.values()) {
> +                if (type.equals(value.type)) {
> +                   return value;
> +                }
> +             }
> +             return UNRECOGNIZED;
> +          }
> +          return null;
> +      }

@pimenas is correct. 
Specifics: Personally I am very much in favor of supporting both null, unrecognized, and case-insensitive
matching in the enums. This is mostly because it ensures that if undocumented behavior changes,
jclouds still works. (Clearly documented nullability might have to be handled differently,
for example).

I actually like the logger.warn on UNRECOGNIZED and I think I will add it to the wiki example.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13311734
Mime
View raw message