> + }
> +
> + /**
> + * 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;
> + }
I like your implementation, I think a `valueOfIgnoreCase()` is not needed here,
and the log level I believe it should be warn() so that future
extensions/changes can be noticed sooner.
The problem I have with this implementation is the logger variable. I cannot
use the following code to inject a logger because it needs to be references
from a static context, and I don't think the @Resource will work if I change
the logger to static.
```
@Resource
private Logger logger = Logger.NULL;
```
By searching the code I found the following which uses the
`java.util.logging.Logger` (code taken from VirtualMachineApiLiveTest.java)
```
private static final Logger logger = Logger.getAnonymousLogger();
```
So any suggestions on the logger, or should I remove it?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/339/files#r13331588