You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Zack Shoylev <no...@github.com> on 2014/06/03 00:57:43 UTC

Re: [jclouds] openstack console (#339)

> +      }
> +
> +      /**
> +       * 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