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